alecthomas / chroma

A general purpose syntax highlighter in pure Go
MIT License
4.33k stars 395 forks source link

pygments2chroma: escape regex.words #982

Closed oliverpool closed 2 months ago

oliverpool commented 2 months ago

Discovered while building on top of https://github.com/alecthomas/chroma/issues/877#issuecomment-1858982870 (by @miliog)

The pygments "regex.words" should be escaped, since they may contain special regex chars (like ^ or +).