How can i print the original Inline code instead of the converted text?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 11d 3h
- Merged PRs (30d)
- 6
Description
What I am trying to do is to parse only headers and then get the original text without parsing the string.
Something like:
# This is a header
Hello **everyone** this is a list:
- Item 1;
- Item 2
And I've done something like this:
string chapterContent = "";
foreach (var element in document.Descendants()) {
if (element is HeadingBlock header) {
var chapterTitle = header.Inline.FirstChild.ToString().Trim();
}
else if(element is ParagraphBlock paragraph) {
chapterContent += paragraph.Inline.FirstChild.ToString()
}
}
But The result is:
Hello everyone this is a list: Item 1; Item 2
Instead of:
Hello **everyone** this is a list:
- Item 1;
- Item 2
Because I want to maintain the original code, then I suppose the "ToString()" is not what I am looking for.
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 tracing how HeadingBlock and ParagraphBlock expose their Inline content and what ToString() returns for those nodes. Determine whether the parser retains the original Markdown source for the requested elements; done means extracting the heading and surrounding text with emphasis and list markers preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, markdown
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100