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

Fix angle bracket being confused as diff #1854

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

tancnle
Copy link
Collaborator

@tancnle tancnle commented Jul 30, 2022

Angle bracket < and > at the start of the string is confused as inserted and deleted line by diff lexer.

This change ensures we only pick up inserted line if there is some space between > and the next character, or immediately followed by a new line. The same rule also applies to the deleted line.

Screen Shot 2022-07-30 at 8 42 09 pm

Relates to #1850

This fixes issue with highlighting content with angle bracket (<, >) in
a diff. For example, `<span>` is no longer picked up as deleted, even
when it is at the start of string.
@tancnle
Copy link
Collaborator Author

tancnle commented Jul 30, 2022

👋🏼 @redonkulus could you kindly have a look at this PR and see if it helps to address the reported issue? 🙏

@tancnle tancnle force-pushed the fix.angle-bracket-diff-lexer branch from 5ec1e34 to 595fd8a Compare July 30, 2022 11:11
@redonkulus
Copy link

This looks good to me! Thanks for the quick turnaround.

@tancnle tancnle merged commit cc6f02b into rouge-ruby:master Aug 3, 2022
@tancnle tancnle deleted the fix.angle-bracket-diff-lexer branch August 3, 2022 00:46
@redonkulus
Copy link

@tancnle when do you think this will be released?

@redonkulus
Copy link

@tancnle any word on a release for this?

@tancnle
Copy link
Collaborator Author

tancnle commented Aug 24, 2022

@tancnle any word on a release for this?

@redonkulus sorry for the late reply. I will try to cut a release sometime before the end of this week.

@tancnle
Copy link
Collaborator Author

tancnle commented Sep 7, 2022

@redonkulus FYI, I have cut a new release v4.0.0 which includes this fix. Again, sorry for the delay.

@redonkulus
Copy link

@tancnle Thank you for the release. Since you upgraded to 4.x, jekyll will not pull this fix in since they are on the 3.x major version branch. Was this a breaking change? Is it possible to port this to the 3.x branch so that Jekyll apps can get the fix too?

@redonkulus
Copy link

@tancnle wonder if you are able to back port this to 3.x

@tancnle
Copy link
Collaborator Author

tancnle commented Nov 23, 2022

@tancnle wonder if you are able to back port this to 3.x

I don't think we have the capacity to do backport. I believe since then jekyll has upgraded to support rouge 4.x so you might want to upgrade to pull in the fixes.

@redonkulus
Copy link

@tancnle You are correct, looks like version 4.3.x of jekyll was released with rouge 4.x. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants