summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-03 21:30:36 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-03 21:34:49 +0100
commitd86a5e8a1f469dd79abf3137dba77a71fae2a774 (patch)
treefc7ab35d999322b9d124e41ab80948df23965d26 /tests
parent6fcef9973be4253e5b377251dd9d1921f9738fc1 (diff)
Tidy up raw blocks 🧹
- Better trimming (only trim at the end if necessary) - Fixed block-level layouting - Improved pretty printing - Flip inline variable to block - Flip inline variable to display for math formulas
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/ref/raw.pngbin6338 -> 24986 bytes
-rw-r--r--tests/lang/typ/raw.typ25
-rw-r--r--tests/typeset.rs2
3 files changed, 19 insertions, 8 deletions
diff --git a/tests/lang/ref/raw.png b/tests/lang/ref/raw.png
index 0da49c1b..fbf02760 100644
--- a/tests/lang/ref/raw.png
+++ b/tests/lang/ref/raw.png
Binary files differ
diff --git a/tests/lang/typ/raw.typ b/tests/lang/typ/raw.typ
index 753f1a09..a783216e 100644
--- a/tests/lang/typ/raw.typ
+++ b/tests/lang/typ/raw.typ
@@ -10,6 +10,21 @@
`#[f 1]`
---
+// Multiline block splits paragraphs.
+
+First
+```
+Second
+```
+Third
+
+---
+// Lots of backticks inside.
+````
+```backticks```
+````
+
+---
// Trimming.
// Space between "rust" and "let" is trimmed.
@@ -18,7 +33,9 @@ The keyword ```rust let```.
// Trimming depends on number backticks.
<``> \
<` untrimmed `> \
-<``` trimmed ```>
+<``` trimmed` ```> \
+<``` trimmed ```> \
+<``` trimmed```>
// Multiline trimming.
```py
@@ -29,12 +46,6 @@ def hi():
```
---
-// Lots of backticks inside.
-````
-```backticks```
-````
-
----
// Unterminated.
// Error: 2:1-2:1 expected backtick(s)
`endless
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 63831c22..807d55d9 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -335,7 +335,7 @@ fn register_helpers(scope: &mut Scope, panics: Rc<RefCell<Vec<Panic>>>) {
}
value.pretty(p);
});
- p.push_str(")");
+ p.push(')');
Value::Str(p.finish())
}