Unable to get original content for LinkReferenceDefinitionGroup
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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