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

Documentation for ranges is displayed wrongly #623

Closed
Vampire opened this issue Dec 8, 2020 · 10 comments
Closed

Documentation for ranges is displayed wrongly #623

Vampire opened this issue Dec 8, 2020 · 10 comments
Labels
Milestone

Comments

@Vampire
Copy link

Vampire commented Dec 8, 2020

An image says more than a thousand words, so here you are:
grafik
grafik
So the dots are there, but the first is attributed to the number and is not shown as there are no digits after the dot or something like that. If I add a number after the lit dot it becomes displayed, if I move the dot where it belongs into the pun block it is also displayed.

@erdi
Copy link
Member

erdi commented Dec 9, 2020

Thanks for reporting but this is how this renders for me on Chrome on MacOS:

Screenshot 2020-12-09 at 20 37 59

So it looks like this might be specific to your environment. Any chance you can try and check in a different browser to see if it's any different? Note that this site is generated using a stock standard asciidoctor template (even if the version of asciidoctor has not been updated for a while) and prettify as the source highlighter - I would expect this to affect many documents if there was a problem with this basic setup.

@Vampire
Copy link
Author

Vampire commented Dec 10, 2020

Well, it looks better in Chrome, also here, but still wrong actually.
Also in Chrome there is lit 0. and pun . instead of lit 0 and pun ...
That makes the colors wrong, both dots should be yellowish, not the first blueish:
grafik

That the dot disappears seems to be a combination of the dot being in the wrong span and me having FiraCode as monospaced font in Firefox. .. is a ligature in FiraCode where the two dots are drawn together to better show them as operator. But that does not harmonize too well with those wrong spans. If you look very close at my first screenshot, there is still the left-most pixel of the blue dot visible.

So the actual problem is the same, the first dot is in the wrong span which makes it appear in the wrong color and if Firacode is used as font also makes it almost disappear.

@Vampire
Copy link
Author

Vampire commented Dec 10, 2020

It seems prettify is no longer maintained and it does not actually support Groovy but works relatively fine by using some other grammer. It is not listed as supported language nor by language supported with extension and the request to add Groovy in googlearchive/code-prettify#1 was closed as wont-fix and the same in googlearchive/code-prettify#586 was just ignored.

@Vampire
Copy link
Author

Vampire commented Dec 10, 2020

It seems both builtin alternatives CodeRay and highlight.js have support for Groovy, though in CodeRay it is in beta state.

@Vampire
Copy link
Author

Vampire commented Dec 10, 2020

In the Spock docs we actually use coderay

@erdi erdi added the Manual label Dec 10, 2020
@erdi
Copy link
Member

erdi commented Dec 10, 2020

Thanks for looking into this, Björn, I will take a stab at some point at switching it over to coderay if that's what Spock's docs are using and they do not suffer from the issue.

@erdi
Copy link
Member

erdi commented Jan 8, 2021

Does this look any better for you now, @Vampire? I switched to coderay. The only downside I've noticed is that the name of $() method is highlighted using a different colour (I think it has something to do with coderay thinking it's not a method but part of interpolated string) but I think can live with it if it makes ranges display for you better. ;)

@Vampire
Copy link
Author

Vampire commented Jan 10, 2021

Yes, looks fine now:
grafik
Thanks.

Given the class of the $ I think it is a CodeRay bug that should be reported:
grafik

@Vampire
Copy link
Author

Vampire commented Jan 10, 2021

rubychan/coderay#253

@erdi
Copy link
Member

erdi commented Jan 10, 2021

Thanks for reporting it to coderay!

@erdi erdi closed this as completed Jan 10, 2021
@erdi erdi added this to the 4.1 milestone Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants