Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get original content for LinkReferenceDefinitionGroup #764

Open
doggy8088 opened this issue Jan 23, 2024 · 2 comments
Open

Unable to get original content for LinkReferenceDefinitionGroup #764

doggy8088 opened this issue Jan 23, 2024 · 2 comments
Labels

Comments

@doggy8088
Copy link

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
    }
}
@xoofx xoofx added the question label Jan 23, 2024
@xoofx
Copy link
Owner

xoofx commented Jan 23, 2024

LinkReferenceDefinitionGroup has no parsing equivalent so cannot have a representation in text. It is just used internally to group LinkReferenceDefinition and query for links.

@doggy8088
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants