Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check that markup inside a token is escaped
Every escape the checks looked at sat between tokens or in the tail a
lexer left untagged, so a filter that escaped only those would have
passed with a string literal reaching the page raw.
Diffstat (limited to 'tests/extensions')
| -rw-r--r-- | tests/extensions/test-syntax-highlight.lua | 3 |
1 file changed, 3 insertions, 0 deletions
diff --git a/tests/extensions/test-syntax-highlight.lua b/tests/extensions/test-syntax-highlight.lua index 8acbf91..b54dc84 100644 --- a/tests/extensions/test-syntax-highlight.lua +++ b/tests/extensions/test-syntax-highlight.lua @@ -59,6 +59,9 @@ h.contains("bytes between tokens are escaped", out, " & ") h.contains("later tokens still highlight", out, "<span class='hl-keyword'>zz</span>") h.equals("close answers zero", ret, 0) +out = render("hello.fake", "'<b>&'") +h.equals("markup inside a token is escaped", out, "<span class='hl-string'>'<b>&'</span>") + out = render("hello.fake", "$color :hover") h.contains("a css property takes the number class", out, "<span class='hl-number'>$color</span>") h.contains("a css pseudo-class takes the function class", out, "<span class='hl-func'>:hover</span>") |
