Open xeo545x39 opened 1 year ago
Facing the same problem on Windows. Could make a workaround on saving markdown documents in "LF" instead of Windows default "CRLF". Therefore seems to be a line-ending problem on Windows which markdig isn't capable of. In my code I replace CRLF line-endings with LF.
Facing the same problem on Windows. Could make a workaround on saving markdown documents in "LF" instead of Windows default "CRLF". Therefore seems to be a line-ending problem on Windows which markdig isn't capable of. In my code I replace CRLF line-endings with LF.
At which moment do you do that? I was trying to save the original file LF like you said as below, but didnt help.
Facing the same problem on Windows. Could make a workaround on saving markdown documents in "LF" instead of Windows default "CRLF". Therefore seems to be a line-ending problem on Windows which markdig isn't capable of. In my code I replace CRLF line-endings with LF.
At which moment do you do that? I was trying to save the original file LF like you said as below, but didnt help.
For me during testing it worked saving the file as LF via Visual Studio Code.
In our tool that uses markdig we at first read from the file and directly after that replace the CRLF with LF as follows:
var markdown = File.ReadAllText(file.SourceAbsolutePath).Replace("\r\n", "\n");
That's our workaround currently to be able to use pipetables.
What version of Markdig do you use and what is a target of build/configuration on which you run? I have Windows 10, AnyCPU, Markdig 0.33.0 and trick with string replace does not work unfortunately :(
Same applies to me, using markdig 0.33.0, running Windows 11. Maybe have a look at our repo? We use it in the Converter file where we load the raw file and apply some custom processors on it. See line 61.
If you're creating a renderer yourself, you must configure it with the pipeline you're using.
var renderer = new RoundtripRenderer(sw);
+pipeline.Setup(renderer);
Otherwise, the renderer won't know what to do with the syntax objects describing the table.
Also, note that EnableTrackTrivia
/ RoundtripRenderer
do not support custom extensions yet (such as tables). They only work with the basic Markdown spec.
@pburndorfer can you please open a new issue describing the problems you are running into w.r.t. new lines?
From the Converter
source you linked to, you're using the regular HTML renderer, so it's unlikely the same issue.
I see that you render it into HTML, not back to Markdown.
var html = Markdown.ToHtml(markdown, pipeline);
Yes, it works. Unfortunately I need Markdown back again. Seems Roundtrip renderer does not work correctly.
Thanks @pburndorfer for additional info.
@MihaZupan Ok, so tables aren't supported in render yet. I think it should be a new feature implemented. Tables are really basics.
The parsing of tables isn't that basic though.
Similar to #155 for the NormalizeRenderer
: PR Welcome :)
To clarify what @MihaZupan explained, there was a tentative of writing a NormalizeRenderer
several years ago that was stopped (due to lack of motivation/personal incentive, help from the community...etc.).
Then someone made a large PR #481 that brought roundtrip parsing and renderer. It is a lot more complicated to bring such feature and the original PR made it "only" for the core part of CommonMark.
Most of the extensions are not supported by roundtrip. Implementing support for them can be a significant amount of work (and can be quite challenging technically), so if you need such feature, expect that you will have to bring that support and it will take lots of time.
@xoofx @MihaZupan Could you give me permission to create a branch on remote? I receive 403. I wanted to make a PR with draft of the feature.
Could you give me permission to create a branch on remote? I receive 403. I wanted to make a PR with draft of the feature.
That's not how usually contributors interact with GitHub projects. You need to create a fork of this repo, create a branch in your fork, create/push commits and then once you are ready you can open a pull request.
Hi,
Given table is rendered as below.