-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix using < or > in a reference name #761
Conversation
7d12189
to
cc2e28c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be issues with false positives here
packages/guides-restructured-text/src/RestructuredText/Parser/InlineLexer.php
Outdated
Show resolved
Hide resolved
30fa949
to
dc06ee1
Compare
You are correct, this was too fragile. I've now rewritten the code to delegate parsing the embedded URI to the rules/roles that need it and removing it from the global inline lexer. This is the safest and shouldn't break anything, given embedded URIs do not exist on their own. |
I like it, it will also make things easier for us in the php-domain text-roles |
dc06ee1
to
9440e98
Compare
These characters are valid and only the last `<...>` must be treated as the embeded URL. This stops using the inline lexer inside references, reSt doesn't allow nested inline nodes and the only thing required is getting the embeded URL (if there is any).
9440e98
to
c0e4b1b
Compare
With phpDocumentor/guides#761 the textroles where changed to not rely on the lexer anymore. This makes it necessary to switch to a regex.
With phpDocumentor/guides#761 the textroles where changed to not rely on the lexer anymore. This makes it necessary to switch to a regex.
With phpDocumentor/guides#761 the textroles where changed to not rely on the lexer anymore. This makes it necessary to switch to a regex.
These characters are valid and only the last
<...>
must be treated as the embedded URL.This PR removes using the inline lexer inside references, reSt doesn't allow nested inline nodes and the only thing required is getting the embedded URL (if there is any). This reduces a lot of complexity