mirror of
https://github.com/typst/typst
synced 2025-06-28 00:03:17 +08:00
Fix raw block highlighting
This commit is contained in:
parent
618beb1ac1
commit
942fa6636d
@ -281,7 +281,7 @@ fn to_syn(RgbaColor { r, g, b, a }: RgbaColor) -> synt::Color {
|
|||||||
|
|
||||||
/// The syntect syntax definitions.
|
/// The syntect syntax definitions.
|
||||||
static SYNTAXES: Lazy<syntect::parsing::SyntaxSet> =
|
static SYNTAXES: Lazy<syntect::parsing::SyntaxSet> =
|
||||||
Lazy::new(|| syntect::parsing::SyntaxSet::load_defaults_newlines());
|
Lazy::new(|| syntect::parsing::SyntaxSet::load_defaults_nonewlines());
|
||||||
|
|
||||||
/// The default theme used for syntax highlighting.
|
/// The default theme used for syntax highlighting.
|
||||||
pub static THEME: Lazy<synt::Theme> = Lazy::new(|| synt::Theme {
|
pub static THEME: Lazy<synt::Theme> = Lazy::new(|| synt::Theme {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 45 KiB |
@ -1,6 +1,7 @@
|
|||||||
// Test code highlighting.
|
// Test code highlighting.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
#set page(width: 180pt)
|
||||||
#set text(6pt)
|
#set text(6pt)
|
||||||
```typ
|
```typ
|
||||||
= Chapter 1
|
= Chapter 1
|
||||||
@ -25,7 +26,9 @@ fn advance(state: State<'_>) -> State<'_> {
|
|||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
#set page(width: 180pt)
|
||||||
#set text(6pt)
|
#set text(6pt)
|
||||||
|
|
||||||
```py
|
```py
|
||||||
import this
|
import this
|
||||||
|
|
||||||
@ -37,6 +40,18 @@ def hi():
|
|||||||
#set page(width: 180pt)
|
#set page(width: 180pt)
|
||||||
#set text(6pt)
|
#set text(6pt)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::cout << "Hello, world!";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
#set page(width: 180pt)
|
||||||
|
#set text(6pt)
|
||||||
|
|
||||||
#rect(inset: (x: 4pt, y: 5pt), radius: 4pt, fill: rgb(239, 241, 243))[
|
#rect(inset: (x: 4pt, y: 5pt), radius: 4pt, fill: rgb(239, 241, 243))[
|
||||||
```html
|
```html
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user