Skip to content
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

Direct access to sourcepos on the Node #15

Closed
danielberndt opened this issue Sep 16, 2015 · 3 comments
Closed

Direct access to sourcepos on the Node #15

danielberndt opened this issue Sep 16, 2015 · 3 comments
Assignees

Comments

@danielberndt
Copy link

I'm trying to do some advanced commonmark processing of my users' input and would like to have direct access to the sourcepos attribute on the node.

Right now, the only way I could make it work is to convert the node to html and parse the resulting html:

m = /<li data-sourcepos="(\d+):(\d+)-(\d+):(\d+)">)/.match node.to_html(:sourcepos)

is there a more direct way to do this?

@gjtorikian
Copy link
Owner

Oh my. I'll expose this.

@gjtorikian gjtorikian self-assigned this Sep 16, 2015
@danielberndt
Copy link
Author

Lovely! Thanks a lot!

@danielberndt
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants