Inlines Span, Column, Line are empty #46

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

Originally created by @vors on GitHub (Jul 24, 2016).

I noticed ASTs Span, Column, Line and was hoping to use the same for inlines. But they are empty.
Here is a repro, to show what I mean. The repro is in powershell, I hope it's not too much troubles to decrypt it.

# load dll in the PowerShell session
> Import-Module Markdig.dll
> $ast = [Markdig.Markdown]::Parse("`n`n[foo](bar)")
> $ast                                                                                                   


LastLine                  : 1
Inline                    : {Markdig.Syntax.Inlines.LiteralInline}
ProcessInlines            : True
Parent                    : {Markdig.Syntax.ParagraphBlock}
Parser                    : Markdig.Parsers.ParagraphBlockParser
IsOpen                    : True
IsBreakable               : True
RemoveAfterProcessInlines : False
Column                    : 0
Line                      : 2
Lines                     : 
Span                      : 2-11



> $ast.Inline                                                                                            


Parent          : {Markdig.Syntax.Inlines.LiteralInline}
PreviousSibling : 
NextSibling     : 
IsClosed        : False
Column          : 0
Line            : 0
Content         : foo
Span            : 0-0

Note that in the first case Column, Line and Span are all correctly populated, but for the Inline they are all 0.

Originally created by @vors on GitHub (Jul 24, 2016). I noticed ASTs Span, Column, Line and was hoping to use the same for inlines. But they are empty. Here is a repro, to show what I mean. The repro is in powershell, I hope it's not too much troubles to decrypt it. ``` powershell # load dll in the PowerShell session > Import-Module Markdig.dll > $ast = [Markdig.Markdown]::Parse("`n`n[foo](bar)") > $ast LastLine : 1 Inline : {Markdig.Syntax.Inlines.LiteralInline} ProcessInlines : True Parent : {Markdig.Syntax.ParagraphBlock} Parser : Markdig.Parsers.ParagraphBlockParser IsOpen : True IsBreakable : True RemoveAfterProcessInlines : False Column : 0 Line : 2 Lines : Span : 2-11 > $ast.Inline Parent : {Markdig.Syntax.Inlines.LiteralInline} PreviousSibling : NextSibling : IsClosed : False Column : 0 Line : 0 Content : foo Span : 0-0 ``` Note that in the first case Column, Line and Span are all correctly populated, but for the Inline they are all 0.
claunia added the questioninvalid labels 2026-01-29 14:23:03 +00:00
Author
Owner

@xoofx commented on GitHub (Jul 24, 2016):

They are not activated by default as exact inline spans are more costly to calculate but you can activate them using the pipeline extension UsePreciseSourceLocation

@xoofx commented on GitHub (Jul 24, 2016): They are not activated by default as exact inline spans are more costly to calculate but you can activate them using the pipeline extension [`UsePreciseSourceLocation`](https://github.com/lunet-io/markdig/blob/64d81ed47b3690c4a7b0cc62dc661b4339604a5c/src/Markdig/MarkdownExtensions.cs#L111)
Author
Owner

@vors commented on GitHub (Jul 24, 2016):

I see, thank you!

@vors commented on GitHub (Jul 24, 2016): I see, thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#46