markdig
markdig copied to clipboard
Unable to get original content for LinkReferenceDefinitionGroup
I'm parsing a Markdown document that contains LinkReferenceDefinitionGroup . When I call ToPositionText()
method for that part of the MarkdownDocument, the line and column will be 0
and 0
, and the Range is wrong too. I don't know how to fix this. Any hint?
var document = Markdown.Parse(markdownText);
var parts = document.ToList();
for (int i = 0; i < parts.Count; i++)
{
var item = parts[i];
if (item is Markdig.Syntax.LinkReferenceDefinitionGroup)
{
// item.Line = 0
// item.Column = 0
// item.ToPositionText(); // $0, 0, 0-79
}
}
LinkReferenceDefinitionGroup
has no parsing equivalent so cannot have a representation in text. It is just used internally to group LinkReferenceDefinition
and query for links.
It because I use Markdig to traversal the Markdown document for translation purpose. I need to keep all the content as-is. When I parse to the LinkReferenceDefinitionGroup
, I don't have the position info. So that I can't get the original content. I need that info the keep my final Markdown document complete.
Can you still provide Position info for this block?