-
Notifications
You must be signed in to change notification settings - Fork 20
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
Expose source position to scanners and extensions #53
Comments
This would require also adding a proper way for extensions to signal failure. |
I think raising an exception would be sufficient. |
Well I think it's not the best way to solve the problem, mostly because this
So for now throwing is an option because the code is written as it's written, but I think we should improve this in the future, or at least try to. |
I agree on all of your points. However, I think that the error handling depends on the source position, so the latter would be best to implement first. If I'd submit a patch to add source position / span for code blocks and inline urls would that make for acceptable first step? |
Well you could try, but my understanding is that it's not trivial to get quite right and it may make the parser slower. Be prepared that I may be picky about the solution. |
Would it be possible to expose the source position for scanners and extension building functions? I have two use cases that would greatly benefit from this:
Many extensions can fail on bad markup. Currently, when this happens it can be really hard find out where it happened. For example, I would like to typecheck my code examples.
Wiki like editing would benefit from this as it would allow the generated html to point at the original source
I did notice that this was mentioned in the documentation. You can count this issue as a vote for adding the source locations + an offer to do some of the work.
The text was updated successfully, but these errors were encountered: