-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcepos not defined for inline elements #155
Comments
Currently only nodes with block-level elements (paragraphs, code blocks, etc.) get sourcepos set. Not inlines. It would be good to add sourcepos to inlines; this has now been done in cmark, which has largely parallel code. |
I've just ran into this limitation in my own project. I've had a look to see if I could put this in but I'm not familiar enough with the codebase. It looks like the test suite only tests parsing the Markdown and generating Javascript; I can't see any coverage of the intermediate products. |
In case you want to work on it, here is what needs to be done. (I'd suggest looking at the parallel change in cmark too.) Each block node that will eventually contain inlines contains a |
Trying to parse this file with commonmark as follows:
Where
source
is:The node with
Additional description
literal ends up havingundefined
sourcepos. According to the description,sourcepos
property is listed under "The following public properties are defined".The resulting node is:
Expected:
node.sourcepos
contains an arrayActual:
node.sourcepos
is undefinedThe text was updated successfully, but these errors were encountered: