rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.31k stars 732 forks source link

Fix angle bracket being confused as diff #1854

Closed tancnle closed 1 year ago

tancnle commented 1 year ago

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 https://github.com/rouge-ruby/rouge/issues/1850

tancnle commented 1 year ago

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

redonkulus commented 1 year ago

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

redonkulus commented 1 year ago

@tancnle when do you think this will be released?

redonkulus commented 1 year ago

@tancnle any word on a release for this?

tancnle commented 1 year ago

@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 commented 1 year ago

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

redonkulus commented 1 year ago

@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 commented 1 year ago

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

tancnle commented 1 year ago

@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 commented 1 year ago

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