Partial rendering #186

Closed
opened 2026-01-29 14:29:48 +00:00 by claunia · 2 comments
Owner

Originally created by @macaba on GitHub (Feb 2, 2018).

I'm trying to partially render markdown injected inline with existing paragraph content:

So I'd like:
_italic_

to render as:
<em>italic</em>

rather than:
<p><em>italic</em></p>

Is there an option to do this?

Originally created by @macaba on GitHub (Feb 2, 2018). I'm trying to partially render markdown injected inline with existing paragraph content: So I'd like: `_italic_` to render as: `<em>italic</em>` rather than: `<p><em>italic</em></p>` Is there an option to do this?
claunia added the questionenhancement labels 2026-01-29 14:29:48 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 2, 2018):

There are no options for this. Just trim <p> and </p> after converting to HTML.
Not sure it might be just a little option to add but more work involved to bring a clean support for this, so if trimming is acceptable, it is recommended.

@xoofx commented on GitHub (Feb 2, 2018): There are no options for this. Just trim `<p>` and `</p>` after converting to HTML. Not sure it might be just a little option to add but more work involved to bring a clean support for this, so if trimming is acceptable, it is recommended.
Author
Owner

@macaba commented on GitHub (Feb 5, 2018):

Thanks for the response, I'll trim manually.

if (markdown.StartsWith("<p>"))
    markdown = markdown.Substring(3);
if (markdown.EndsWith("</p>\n"))
    markdown = markdown.Substring(0, markdown.Length - 5);
@macaba commented on GitHub (Feb 5, 2018): Thanks for the response, I'll trim manually. ``` if (markdown.StartsWith("<p>")) markdown = markdown.Substring(3); if (markdown.EndsWith("</p>\n")) markdown = markdown.Substring(0, markdown.Length - 5); ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#186