mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 05:44:58 +00:00
Add precise source location for inline elements #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xoofx on GitHub (May 25, 2016).
The current implementation doesn't track accurate source code position for inline elements (link, emphasis...etc.) but only for block parser elements (paragraph, blockquotes...etc.).
In order to optimize the execution, the code is a bit destructive when going through inline parsing (can remove spaces...etc.) but if an IDE wanted to use Markdig for precise syntax highlighting, it would require to be conservative.
Care would have to be taken to make this optional (e.g PreciseSourceLocation)
Work in progress in the precise_location branch
@xoofx commented on GitHub (Jun 15, 2016):
Precise source location can now be activated with
MarkdownPipelineBuilder.UsePreciseSourceLocation()Then each AST
MarkdownObjecthave the following properties:See TestSourcePosition.cs for the tests.
There are a few known issues: