xoofx / xoofx/markdig

Unable to get original content for LinkReferenceDefinitionGroup

Open
#764 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

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
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sample with the Markdown.Parse call and inspect LinkReferenceDefinitionGroup, its Line and Column values, and ToPositionText(). Trace how its source range is assigned compared with other parsed nodes; done means the group reports the correct position text, line, column, and range for the referenced Markdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, markdown
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.