mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-12 21:39:32 +00:00
disable leading and ending paragraph #427
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @schmitch on GitHub (Jan 27, 2021).
Hello currently when I'm rendering a simple html string to markdown via markdig:
and the output will be
<p>test <strong>hello</strong></p>is there a way to stop rendering the p tag?@xoofx commented on GitHub (Jan 27, 2021):
No, it's part of CommonMark. You can workaround by trimming start/end of the string.
@jjxtra commented on GitHub (Jan 10, 2023):
Trimming is tricky especially if text has newlines, you can end up trimming out paragraph tags inadvertently.
@xoofx commented on GitHub (Jan 10, 2023):
Trimming is not tricky, because trimming only happens on the edges, so it won't trim intermediate paragraphs
@jjxtra commented on GitHub (Jan 10, 2023):
Trimming leading/tailing
<p> and </p>can screw up the html. This bit me when I trimmed generated text of<p>paragraph 1 text</p>...<p>paragraph 2 text</p>@xoofx commented on GitHub (Jan 10, 2023):
Right, and if it is more complicated than that, you should use something like AngleSharp.
Implementing it in Markdig would not be not more simple.