summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-10 13:17:29 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-10 13:19:03 +0100
commit5965515a1ef1fe398235311185d531efc2750247 (patch)
tree0c375efc16993670951642dd54aa7fc9ac329daf
parent624471db619240f0eed849b92dff6a525ce7e547 (diff)
Allow escaping of `-` and `.`
-rw-r--r--src/parse/tokens.rs2
-rw-r--r--tests/ref/markup/escape.pngbin12375 -> 13675 bytes
-rw-r--r--tests/typ/markup/escape.typ3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs
index 0c125b4b..ca2cb74a 100644
--- a/src/parse/tokens.rs
+++ b/src/parse/tokens.rs
@@ -248,7 +248,7 @@ impl<'s> Tokens<'s> {
// Parenthesis and hashtag.
'[' | ']' | '{' | '}' | '#' |
// Markup.
- '*' | '_' | '=' | '~' | '`' | '$' => {
+ '~' | '*' | '_' | '`' | '$' | '=' | '-' | '.' => {
self.s.eat_assert(c);
NodeKind::Escape(c)
}
diff --git a/tests/ref/markup/escape.png b/tests/ref/markup/escape.png
index 4d2b570e..3434d6e0 100644
--- a/tests/ref/markup/escape.png
+++ b/tests/ref/markup/escape.png
Binary files differ
diff --git a/tests/typ/markup/escape.typ b/tests/typ/markup/escape.typ
index 87d2b83a..6ec469c1 100644
--- a/tests/typ/markup/escape.typ
+++ b/tests/typ/markup/escape.typ
@@ -24,6 +24,9 @@
// Some code stuff in text.
let f() , ; : | + - /= == 12 "string"
+// Escaped dot.
+10\. May
+
---
// Unicode codepoint does not exist.
// Error: 1-11 invalid unicode escape sequence