-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Issue with Elixir highlighting #707
Comments
Am I right that with this syntax function body ends with new line? ( |
@Sannis I don't think so. The # This reproduces the bug
def foo, do:
3 + 5 or # This is highlighted perfectly fine
def foo, do: 3 +
4 +
5 |
@Sannis @whatyouhide What is the status about that? we really would like to fix this because we love to use it in Before I'm starting looking into it by myself, maybe you guys can have a quick look before me. :) @knewter I know you have a lot to do, but if you got a few minutes, please have look. ❤️ :-) |
Any news on this? As @tonini said, we would really really love to fix this since it's screwing up a lot of examples in Elixir's documentation (as well as in the documentation of every library using |
Urk, what's the situation with the tests these days? On Fri, Jan 30, 2015 at 9:06 AM, Andrea Leopardi notifications@github.com
Josh Adams |
@knewter the docs on testing are here: http://highlightjs.readthedocs.org/en/latest/building-testing.html (in short, we now have tools/developer.html to play with markup). I'm not sure when any one of us will be able to look into it (for me it's probably next Tuesday), so feel free to pick it up. |
I'm looking at it now, we'll see if anything comes of it /cc @tonini @whatyouhide |
so @tonini @whatyouhide @josevalim I have a few questions about this one. In this case, isn't do an atom in an optionlist? That's the core problem here - it's matching "thing: other" such that thing is an atom in the list. That's matching do. I can change the regex such that do isn't matched, in which case it would become a keyword...but then you would always get that behaviour if you used do: in an optionlist as well, which is wrong (but better?) Basically, I need to do this work when @josevalim or someone is around to help explain to me my misunderstandings like this in the parser. Sadly the highlight.js syntax checking is in no way presently easy to 'port' from the actual tokenizer in elixir, primarily due to my lack of experience here (only parsers I've really written that were complicated were PEGs) |
@knewter I think the problem is not that Note that this is valid Elixir syntax: %{a:
3} or [do:
something] |
Aha I missed the point entirely :)
|
Am I getting this right that in the case of
The comma
? |
@isagalaev what comes after def foo, do: (IO.puts "hello"; IO.puts " world") produces internally the exact same code as: def foo do
IO.puts "hello"
IO.puts " world"
end |
Awesome, thank you! |
much appreciated @isagalaev ! |
Awesome @isagalaev, thanks so much! ❤️ |
This is great. I can stop feeling terrible now! ❤️
|
This HTML snippet:
produces this buggy result:
because of the
def f, do: # code
syntax (as an alternative to the usualdo
/end
block, which works just fine). I think @knewter took care of the Elixir highlighting, so if he has a quick fix that would be great! Otherwise, I'll try to start working on it as soon as I can. I never contributed to highlight.js though, so it could take me a while to get familiar with it 😞.The text was updated successfully, but these errors were encountered: