-
-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unabled to convert empty lines into the correct HTML element #698
Comments
It depends on the options you are using. The default is that it should be CommonMark compliant, and it means that you don't get |
Thanks for the quick response @xoofx! In regard to the However, I've tried adding the extension needed to create hard break lines but I still get the same output. |
Yep, but the extension is for lines within a paragraph, not trailing blank lines. The problem is that blank lines are used to break paragraph already. It's part of CommonMark parsing rules and this is not something that can be changed. |
I am also finding this a problem |
Why Github not following this stupid rule?
How to keep structure of documents then? |
A blank line is not considered as a structure. Don't use Markdown in that case. |
Here's an image showing what the markdown text I'm trying to convert looks like:
![image](https://user-images.githubusercontent.com/125599062/219459185-180faa55-4c05-450e-8777-7c1585023235.png)
Here's the value I have relative to the previous image:
TEST 1\n\nTEST 2\n\nTEST 3\n\n- TEST 4\n- TEST 5
Here's the output I'm getting from the
Markdown.ToHtml
method:<p>TEST 1</p>\n<p>TEST 2</p>\n<p>TEST 3</p>\n<ul>\n<li>TEST 4</li>\n<li>TEST 5</li>\n</ul>\n
The output is returned with a bunch of
\n
that aren't converted successfully to HTML tags.Here's the output I was expecting to get:
<p>TEST 1</p><br><p>TEST 2</p><br><p>TEST 3</p><br><ul><li>TEST 4</li><li>TEST 5</li></ul>
The text was updated successfully, but these errors were encountered: