-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Keep Markup plugin incorrect highlighting #880
Conversation
Hey, thanks for looking into this! It's a nice little plugin and it's sad that it had that bug. I’m very surprised this fix works. The new regex won't match newlines in many (if not all) modern systems, since they tend to be |
Yes it does. it works perfectly in Firefox and Chrome if you comment out the whole firstWhiteSpaces stuff. |
I guess I wrote it at a time where the initial line feeds were trimmed in the core. |
It would probably stop working in combination with any plugin, that trims whitespace or changes the length of the text in any way. Like my proposed whitespace normalizer plugin #847. |
Hey! thanks for answer :)
Yes, by removing the |
Good! Should I close this PR so you can send a new one or do you prefer to update it?
We can make sure to include that plugin before this one. |
Hi @LeaVerou I just updated this PR with the latest changes. |
Fix Keep Markup plugin incorrect highlighting
Awesome, thanks! |
Thanks to you! |
Hi @LeaVerou I just noticed the Gulpfile task :) |
Ah yeah, you need to run gulp. |
So, I should send another PR with the minified version updated to the I am just trying to understand how is the branch workflow :) |
It is usually a good idea, to include the minified version in your PR. You don't have to create a new PR for We periodically run gulp on the |
@montogeek I used the example from website:
and the bug still happens, its not aligned |
Hi!
This change fixes #879, it looks like that the Regex replace is messing the correct positions of the markers in the markup, that's why it looked moved one position:
After this fix it looks like this:
I am not completely sure about this fix because I do not have experience with Prism, probably @Golmote or @LeaVerou can find the real issue.
Thanks!