Empty LiteralInline #48

Closed
opened 2026-01-29 14:23:07 +00:00 by claunia · 1 comment
Owner

Originally created by @Kryptos-FR on GitHub (Jul 24, 2016).

The following markdown generates an empty LiteralInline before the line break (notice the empty spaces at the end of the line to force a break) :

> *some text* 
> some other text

whereas this doesn't:

> some text 
> some other text

As a workaround, in my renderer, I can check if the content of the literal is empty and ignore it in this case. But IMHO it should be the job of the parser to get rid of it in the first place.

if (obj.Content.IsEmpty)
    return;
Originally created by @Kryptos-FR on GitHub (Jul 24, 2016). The following markdown generates an empty LiteralInline before the line break (notice the empty spaces at the end of the line to force a break) : ``` > *some text* > some other text ``` whereas this doesn't: ``` > some text > some other text ``` As a workaround, in my renderer, I can check if the content of the literal is empty and ignore it in this case. But IMHO it should be the job of the parser to get rid of it in the first place. ``` csharp if (obj.Content.IsEmpty) return; ```
claunia added the enhancement label 2026-01-29 14:23:07 +00:00
Author
Owner

@xoofx commented on GitHub (Sep 19, 2016):

This should be fixed by commit c43d5cc
The fix is only valid for this particular case. There might be other places in the code where a LiteralInline could be ended empty.

@xoofx commented on GitHub (Sep 19, 2016): This should be fixed by commit c43d5cc The fix is only valid for this particular case. There might be other places in the code where a LiteralInline could be ended empty.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#48