Skip to content

Commit

Permalink
Merge pull request #7693 from quarto-dev/fix/typst-code
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Nov 24, 2023
2 parents 7fe97be + c334bd3 commit 1a8c1af
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/resources/formats/typst/pandoc/quarto/definitions.typ
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@

// Some quarto-specific definitions.

#show raw: it => {
if it.block {
block(fill: luma(230), width: 100%, inset: 8pt, radius: 2pt, it)
} else {
it
}
}
#show raw.where(block: true): block.with(
fill: luma(230),
width: 100%,
inset: 8pt,
radius: 2pt
)

#let block_with_new_content(old_block, new_content) = {
let d = (:)
Expand Down
20 changes: 20 additions & 0 deletions tests/docs/smoke-all/2023/11/24/typst-code.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
format: typst
---

This is an inline code `x + 1`

And this is a code block

```
1 + 1
```

Now with lang attributes
```r
1 + 1
```

also inline `<div>`{.html}

This is also suppose to work `#raw("x + y")`{=typst}

0 comments on commit 1a8c1af

Please sign in to comment.