Skip to content

Commit

Permalink
fix: inline raw with lang tag (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer authored Mar 15, 2024
1 parent 054e835 commit 1340939
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ impl PrettyPrinter {
}
if let Some(lang) = child.cast::<RawLang>() {
doc = doc.append(trivia(lang.to_untyped()));
doc = doc.append(BoxDoc::hardline());
doc = doc.append(if is_block {
BoxDoc::hardline()
} else {
BoxDoc::space()
});
}
if let Some(line) = child.cast::<Text>() {
doc = doc.append(trivia(line.to_untyped()));
Expand Down
7 changes: 7 additions & 0 deletions tests/assets/unit/markup/raw.typ
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ let a = 1;
let d = 1;
```
]


```typ #link()```


```typ #link()
```
6 changes: 6 additions & 0 deletions tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ let a = 1;
let d = 1;
```
]

```typ #link()```

```typ
#link()
```
6 changes: 6 additions & 0 deletions tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ let a = 1;
let d = 1;
```
]

```typ #link()```

```typ
#link()
```
6 changes: 6 additions & 0 deletions tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ let a = 1;
let d = 1;
```
]

```typ #link()```

```typ
#link()
```

0 comments on commit 1340939

Please sign in to comment.