mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
When doing .ToHtml() how to avoid the outer <p> element? #557
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 @thepra on GitHub (Sep 12, 2022).
Can't quite figure out how to get rid of that
<p>element in every parsed markdown.My context is that I want to put the parsed markdown in the
<summary>element, but<p>make the parsed text go to a new line, making an ugly looking summary.Or even better it would nice to know how to choose with which outer HTML element parse the markdown to HTML.
@xoofx commented on GitHub (Sep 12, 2022):
Use
String.Replaceor a library like AngleSharp (for more advanced scenarios). There is no plan to customize in Markdig the HtmlRenderer for such scenarios.@MihaZupan commented on GitHub (Sep 12, 2022):
You can also write a custom renderer based on the built-in
ParagraphRenderer.Something like
MyParagraphExtension.cs
@jjxtra commented on GitHub (Jan 10, 2023):
This still puts in a
and ending
even for text without newlines. How do I turn that behavior off?@xoofx commented on GitHub (Jan 10, 2023):
string.StartWith + replace and/or trim.