diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-03 17:46:53 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-03 17:46:53 +0100 |
| commit | 9e918d06adfdd680f153784e85657e45e9675ec6 (patch) | |
| tree | 3f411c1cc7b2ed7855ca1433e6ad1f0a7ab1701c /tests/typ/text/raw-code.typ | |
| parent | fd7b629f674e8ac66394c6cb8f945446003e4486 (diff) | |
Fix function call highlighting
Diffstat (limited to 'tests/typ/text/raw-code.typ')
| -rw-r--r-- | tests/typ/text/raw-code.typ | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/typ/text/raw-code.typ b/tests/typ/text/raw-code.typ new file mode 100644 index 00000000..d89f1c05 --- /dev/null +++ b/tests/typ/text/raw-code.typ @@ -0,0 +1,58 @@ +// Test code highlighting. + +--- +#set text(6pt) +```typ += Chapter 1 +#lorem(100) + +#let hi = "Hello World" +#show heading: emph +``` + +--- +#set page(width: 180pt) +#set text(6pt) + +```rust +/// A carefully designed state machine. +#[derive(Debug)] +enum State<'a> { A(u8), B(&'a str) } + +fn advance(state: State<'_>) -> State<'_> { + unimplemented!("state machine") +} +``` + +--- +#set text(6pt) +```py +import this + +def hi(): + print("Hi!") +``` + +--- +#set page(width: 180pt) +#set text(6pt) + +#rect(inset: (x: 4pt, y: 5pt), radius: 4pt, fill: rgb(239, 241, 243))[ + ```html + <!DOCTYPE html> + <html> + <head> + <meta charset="utf-8"> + </head> + <body> + <h1>Topic</h1> + <p>The Hypertext Markup Language.</p> + <script> + function foo(a, b) { + return a + b + "string"; + } + </script> + </body> + </html> + ``` +] |
