How to generate inline html ? #702

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

Originally created by @BeepBeepBopBop on GitHub (Oct 3, 2024).

Hello, I am new to Markdig and I have the following use-case:

I am trying to write a UI similar to Chat GPT's when the assistant is responding, with a string of characters followed by a circle. Here is the simplified code:

<p style="display: inline;">
     <span style="display: inline;">
         @((MarkupString)Markdig.Markdown.ToHtml(MessageViewModel.Text))
     </span>

     <span style="display: inline;">
         X
     </span>
 </p>

-> The issue that I have is that Markdig generates block elements. Is there a way to configure the behavior so that the "X" in the code above appears on the same line as the html generated by Markdig ?

Thanks a lot for your help.

Originally created by @BeepBeepBopBop on GitHub (Oct 3, 2024). Hello, I am new to Markdig and I have the following use-case: I am trying to write a UI similar to Chat GPT's when the assistant is responding, with a string of characters followed by a circle. Here is the simplified code: ``` <p style="display: inline;"> <span style="display: inline;"> @((MarkupString)Markdig.Markdown.ToHtml(MessageViewModel.Text)) </span> <span style="display: inline;"> X </span> </p> ``` **-> The issue that I have is that Markdig generates block elements. Is there a way to configure the behavior so that the "X" in the code above appears on the same line as the html generated by Markdig ?** Thanks a lot for your help.
claunia added the invalid label 2026-01-29 14:43:23 +00:00
Author
Owner

@AmadeusW commented on GitHub (Oct 3, 2024):

I don't think it's a bug on markdig. You can achieve what you want in CSS, using display: flex rather than display:inline, with with align-items: flex-end. Here's details: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

@AmadeusW commented on GitHub (Oct 3, 2024): I don't think it's a bug on markdig. You can achieve what you want in CSS, using `display: flex` rather than `display:inline`, with with `align-items: flex-end`. Here's details: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Author
Owner

@xoofx commented on GitHub (Oct 3, 2024):

Agreed, not really a bug or an issue with markdig, but HTML/CSS related.

@xoofx commented on GitHub (Oct 3, 2024): Agreed, not really a bug or an issue with markdig, but HTML/CSS related.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#702