summaryrefslogtreecommitdiff
path: root/tests/typ/text/raw.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/text/raw.typ')
-rw-r--r--tests/typ/text/raw.typ59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/typ/text/raw.typ b/tests/typ/text/raw.typ
new file mode 100644
index 00000000..0e053a9b
--- /dev/null
+++ b/tests/typ/text/raw.typ
@@ -0,0 +1,59 @@
+// Test raw blocks.
+
+---
+// No extra space.
+`A``B`
+
+---
+// Typst syntax inside.
+`#let x = 1` \
+`#f(1)`
+
+---
+// Multiline block splits paragraphs.
+
+First
+```
+Second
+```
+Third
+
+---
+// Lots of backticks inside.
+````
+```backticks```
+````
+
+---
+// Trimming.
+
+// Space between "rust" and "let" is trimmed.
+The keyword ```rust let```.
+
+// Trimming depends on number backticks.
+<``> \
+<` untrimmed `> \
+<``` trimmed` ```> \
+<``` trimmed ```> \
+<``` trimmed```>
+
+// Multiline trimming and dedenting.
+#block[
+ ```py
+ import this
+
+ def hi():
+ print("Hi!")
+ ```
+]
+
+---
+// First line is not dedented and leading space is still possible.
+ ``` A
+ B
+ C```
+
+---
+// Unterminated.
+// Error: 2:1 expected 1 backtick
+`endless