summaryrefslogtreecommitdiff
path: root/crates/typst-html
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-07-10 12:54:06 +0200
committerGitHub <noreply@github.com>2025-07-10 10:54:06 +0000
commit275012d7c624be85173315286752888e20996072 (patch)
tree902db921719c9e0cf399bbe48372f4d8f347273b /crates/typst-html
parent98802dde7e3eab456bf4892b586076431e3bb386 (diff)
Handle `lower` and `upper` in HTML export (#6585)
Diffstat (limited to 'crates/typst-html')
-rw-r--r--crates/typst-html/src/convert.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/typst-html/src/convert.rs b/crates/typst-html/src/convert.rs
index 49995e0a..171b4cb7 100644
--- a/crates/typst-html/src/convert.rs
+++ b/crates/typst-html/src/convert.rs
@@ -86,7 +86,12 @@ fn handle(
} else if child.is::<SpaceElem>() {
output.push(HtmlNode::text(' ', child.span()));
} else if let Some(elem) = child.to_packed::<TextElem>() {
- output.push(HtmlNode::text(elem.text.clone(), elem.span()));
+ let text = if let Some(case) = styles.get(TextElem::case) {
+ case.apply(&elem.text).into()
+ } else {
+ elem.text.clone()
+ };
+ output.push(HtmlNode::text(text, elem.span()));
} else if let Some(elem) = child.to_packed::<LinebreakElem>() {
output.push(HtmlElement::new(tag::br).spanned(elem.span()).into());
} else if let Some(elem) = child.to_packed::<SmartQuoteElem>() {