Inline elements should have correct Span (not zero-filled) #416

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

Originally created by @KvanTTT on GitHub (Nov 9, 2020).

Consider the following markdown fragment:

a `b` **c**

The parser returns ContainerInline node with the following children:

[0] = {LiteralInline} a 
[1] = {CodeInline} `b`
[2] = {LiteralInline}  
[3] = {EmphasisInline} 42 '*' Count: 2

But all Span properties of these nodes are zero-filled (0-0) though they should not.

How can I get the correct position of inline nodes?

Originally created by @KvanTTT on GitHub (Nov 9, 2020). Consider the following markdown fragment: ``` a `b` **c** ``` The parser returns `ContainerInline` node with the following children: ``` [0] = {LiteralInline} a [1] = {CodeInline} `b` [2] = {LiteralInline} [3] = {EmphasisInline} 42 '*' Count: 2 ``` But all `Span` properties of these nodes are zero-filled (`0-0`) though they should not. How can I get the correct position of inline nodes?
Author
Owner

@KvanTTT commented on GitHub (Nov 9, 2020):

It works fine if I set PreciseSourceLocation in the following way:

var builder = new MarkdownPipelineBuilder
{
    PreciseSourceLocation = true
};
MarkdownDocument document = Markdown.Parse(content, builder.Build());
return new MarkdownContainerBlockNode(document, ParseHtmlMarkdown(document));

Sorry for the noise.

@KvanTTT commented on GitHub (Nov 9, 2020): It works fine if I set `PreciseSourceLocation` in the following way: ```cs var builder = new MarkdownPipelineBuilder { PreciseSourceLocation = true }; MarkdownDocument document = Markdown.Parse(content, builder.Build()); return new MarkdownContainerBlockNode(document, ParseHtmlMarkdown(document)); ``` Sorry for the noise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#416