rouge-ruby / rouge

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

don't crash if last line of console snippet ends with \ #1779

Closed mojavelinux closed 2 years ago

mojavelinux commented 2 years ago

resolves #1602

mojavelinux commented 2 years ago

The result may still not be what the user expects. But at least it doesn't cause Rouge to fail.

I have to admit, I don't understand why there is a special case being made for backslash when splitting the lines. There aren't any tests for that case, and it doesn't seem to interpret it as a line continuation. As far as I can see, it's unnecessary character matching.

tancnle commented 2 years ago

Thanks @mojavelinux. Merged 🚀

crazy-max commented 2 years ago

Was able to bissect an issue we have since rouge 3.28.0 with console lexer and seems to be related to this change. More info: https://github.com/docker/docker.github.io/pull/14825#issue-1247204553