Skip to content

Commit

Permalink
Hoon: Fixed escaped strings (#3473)
Browse files Browse the repository at this point in the history
  • Loading branch information
matildepark authored Jun 14, 2022
1 parent 494dfab commit 6464271
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-hoon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prism.languages.hoon = {
greedy: true
},
'string': {
pattern: /"[^"]*"|'[^']*'/,
pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,
greedy: true
},
'constant': /%(?:\.[ny]|[\w-]+)/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-hoon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tests/languages/hoon/strings_with_escapes.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"blah\"blah"

----------------------------------------------------

[
["string", "\"blah\\\"blah\""]
]

0 comments on commit 6464271

Please sign in to comment.