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
(elixir) interpolation, sigils and / functions #730
Comments
@eksperimental to fix this I'm going to remove |
Relates to p.1 from highlightjs#730
@Sannis thanks a lot. please do as you consider convenient. We will adapt our CSS files accordingly. |
Relates to p.1 from highlightjs#730
@eksperimental, am I right that sigils can be also included into string interpolations? It looks like this will be too CPU heavy to do so :-( |
Relates to p.3 from highlightjs#730
Relates to p.2 from highlightjs#730 Unfortunately, we do not distinguish s and S sigils with different interpolation rules
@eksperimental, I fixed some cases and added more regression tests. |
that's great @Sannis |
I'll post highlighting example to the pull request thread today. We currently do releases each 6 weeks, so next one will be only in October. |
Here's the building docs, just in case: http://highlightjs.readthedocs.org/en/latest/building-testing.html |
@isagalaev excellent! thanks a lot for all the help |
@eksperimental can you please post an example highlighting for |
@Sannis nope, it is not, starting from This is how it gets interpreted by Elixir interactive shell iex(1)> ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here }
"Escapes terminators { and }, but no {balancing" so the |
hi @Sannis is there anything else that you need from me? Or anything we can do to help you sort this out? |
About the issue 3, the same thing happens when using simplified anonymous function. I (wrongly) created an issue about this on Ex_doc repo: elixir-lang/ex_doc#486 ( |
Won't make it to 9.0… |
Relates to p.2 from highlightjs#730 Unfortunately, we do not distinguish s and S sigils with different interpolation rules
@eksperimental Any chance you can test PR #2257? I think it fixes points 1 and 2. |
@eksperimental Any chance you could have a look at #2257 and see what you think? |
Oh sorry I already pinged you 3 days ago, lol... I guess think of it was a reminder. :) |
I there a live version where I can test this? |
No, but I could probably build you a demo/devtool zip if it would truly be helpful. |
if you could. I'm out of touch with this lib (and the whole JS ecosystem), and it's been 4 years since I opened up this issue. I 'm doing it out of appreciation becuase someone took the time to take care of this after all these years. |
@eksperimental Sounds like you're busy - and I haven't gotten around to this either. I'm just going to run with this as it. It passes all the original examples provided. If there are additional edge cases we can just let people file them as they see them. Thanks for the offer to help though! |
Cool. Thank you! |
- Do not mistakenly recognize `/:` as the beginning of a regex, which causes highlighting to abort. - `/:`, `+:`, are still not considered symbols This solves the problem by making the `/: \d` an exception case that is never treated as a regex. For most cases, most of the time this should be a win. Resolves highlightjs#730.
- Do not mistake code like `import Kernel, except: [ /: 2 ]` as the beginning of a regex, which causes highlighting to break. - `/:`, `+:`, are still not considered symbols This solves the problem by making the pattern `/: \d` an exception case that is never treated as a regex. For most cases, most of the time this should be a win. Resolves #730.
Update 11/2019: As far as I know #2257 leaves only item 3 open.
~S sigil
.~s
is fine though./:
as the beggining of a regular expression (Closed via fix(elixir) Support function names with a slash #2406)We are adding hightlightjs to https://github.com/elixir-lang/ex_doc/
and when I ran it against the test file for pygments.
In addition to #707, I have run into three new issues:
Every single line bellow, has an issues, it takes it as a comment whatever comes after the #
~S sigil
.~s
is fine though./:
as the beggining of a regular expressionYou can see this live,
Original test doc page, with the problems: http://eksperimental.github.io/issues/highlightjs/Highlight.Elixir.html#pygments/0
Page with the problematic lines removed: http://eksperimental.github.io/issues/highlightjs/Highlight.Elixir+.html#pygments/0
@tonini @knewter
The text was updated successfully, but these errors were encountered: