Open RicBruIAI opened 5 months ago
Every MarkdownObject
has a Span
property that points to the section of the input string it is based on. You must specify UsePreciseSourceLocation
for those positions to be accurate.
private static readonly MarkdownPipeline s_pipeline = new MarkdownPipelineBuilder()
.UsePreciseSourceLocation()
.Build();
Then you can look at the original input like so
else if (element is ParagraphBlock paragraph)
{
string source = markdown.Substring(paragraph.Span.Start, paragraph.Span.Length);
// Hello **everyone** this is a list:
}
What I am trying to do is to parse only headers and then get the original text without parsing the string. Something like:
And I've done something like this:
But The result is:
Hello everyone this is a list: Item 1; Item 2
Instead of:
Because I want to maintain the original code, then I suppose the "ToString()" is not what I am looking for.