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

Scheme's number is missing lookbehind #702

Closed
zot opened this issue Aug 20, 2015 · 5 comments
Closed

Scheme's number is missing lookbehind #702

zot opened this issue Aug 20, 2015 · 5 comments

Comments

@zot
Copy link

zot commented Aug 20, 2015

Scheme's number def needs lookbehind: true -- it begins with a preceding space or close paren

@Golmote
Copy link
Contributor

Golmote commented Aug 20, 2015

Can you please provide examples that are not highlighted properly now and would be fixed with this change?

@zot
Copy link
Author

zot commented Aug 20, 2015

The highlighting shows properly if you don't use the CSS classes for anything other than the default setup. The problem comes when you want to use the CSS class for something like drawing a box around the numbers on hover. This expression:

(+ 3 4)

generates this markup:

(+ 3 4)

Single preceding spaces are included in the "token number" class spans because the regexp has a (\s|)) group at the beginning which matches a single space or close paren. Adding lookbehind: true fixes the problem.

@Golmote
Copy link
Contributor

Golmote commented Aug 21, 2015

Thanks for reporting! 😉

@zot
Copy link
Author

zot commented Aug 21, 2015

Thanks for the timely fix! I fell asleep before I put in a better example, since GitHub stripped the HTML out of the one I gave. Guess you didn't need it :).

@Golmote
Copy link
Contributor

Golmote commented Aug 21, 2015

I understood the problem when I saw the actual code ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants