diff --git a/grammar/janet.tmLanguage b/grammar/janet.tmLanguage
index 77fb9efe..f9f036a1 100644
--- a/grammar/janet.tmLanguage
+++ b/grammar/janet.tmLanguage
@@ -55,6 +55,14 @@
include
#readermac
+
+ include
+ #string
+
+
+ include
+ #longstring
+
include
#literal
@@ -83,14 +91,6 @@
include
#symbol
-
- include
- #string
-
-
- include
- #longstring
-
comment
@@ -261,7 +261,7 @@
(@?")
beginCaptures
- 0
+ 1
name
punctuation.definition.string.begin.janet
@@ -271,7 +271,7 @@
(")
endCaptures
- 0
+ 1
name
punctuation.definition.string.end.janet
@@ -292,20 +292,25 @@
longstring
begin
- @?(`+)
+ (@?)(`+)
beginCaptures
- 0
+ 1
+
+ name
+ punctuation.definition.string.begin.janet
+
+ 2
name
punctuation.definition.string.begin.janet
end
- \1
+ \2
endCaptures
- 0
+ 1
name
punctuation.definition.string.end.janet
diff --git a/grammar/tmcorelib.janet b/grammar/tmcorelib.janet
index 3255d602..b1e9d5dd 100644
--- a/grammar/tmcorelib.janet
+++ b/grammar/tmcorelib.janet
@@ -18,7 +18,7 @@
47 "/"})
(defn- escape
- "Escape special characters for HTML encoding."
+ "Escape special characters for HTML and regex encoding."
[str]
(def buf @"")
(loop [byte :in str]