]> git.ipfire.org Git - thirdparty/jinja.git/commit
Fix literal \ characters at the end of a string 425/head
authorhighlyunavailable <highlyunavailable@gmail.com>
Fri, 20 Mar 2015 18:50:14 +0000 (11:50 -0700)
committerhighlyunavailable <highlyunavailable@gmail.com>
Fri, 20 Mar 2015 18:50:14 +0000 (11:50 -0700)
commite0615edb7590591356384465fec8413ebbeece8c
treea88a50c7f7eab0e695aef2ce7cb7ee60cc6ea82a
parent1b7a7f4f2f64d3aea17d2b2b90789ae86dd376b1
Fix literal \ characters at the end of a string

Given a statement like `{% set sep = '\\' %}`, the syntax highlighter was considering the literal `'\\'` to be a literal quote inside the string by matching `\'` and thus highlighting the rest of the entire document as a string.

This change fixes that issue by adding some regex to ensure that an escaped quote is preceded by an uneven number of slashes (that is, `'\\\\\''` would accept the literal string `\\'` without issues). A`"` quoted string is modified the same way.
ext/Vim/jinja.vim