summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫 <overflowcat@gmail.com>2025-02-18 18:16:19 +0800
committerGitHub <noreply@github.com>2025-02-18 10:16:19 +0000
commit74e4f78687d7acb5db3d531959c956717cce837a (patch)
tree548ddd08acfc7dda7329b9717a956badd91cdb0c
parent25c86accbb4adc0e7542d2c5957dff6e939cbf48 (diff)
HTML export: Use `<code>` for inline `RawElem` (#5884)
-rw-r--r--crates/typst-library/src/text/raw.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/typst-library/src/text/raw.rs b/crates/typst-library/src/text/raw.rs
index b330c01e..1ce8bfc6 100644
--- a/crates/typst-library/src/text/raw.rs
+++ b/crates/typst-library/src/text/raw.rs
@@ -446,10 +446,14 @@ impl Show for Packed<RawElem> {
let mut realized = Content::sequence(seq);
if TargetElem::target_in(styles).is_html() {
- return Ok(HtmlElem::new(tag::pre)
- .with_body(Some(realized))
- .pack()
- .spanned(self.span()));
+ return Ok(HtmlElem::new(if self.block(styles) {
+ tag::pre
+ } else {
+ tag::code
+ })
+ .with_body(Some(realized))
+ .pack()
+ .spanned(self.span()));
}
if self.block(styles) {