mirror of
https://github.com/typst/typst
synced 2025-08-13 14:47:54 +08:00
Compare commits
6 Commits
7c5a5292af
...
a5f371ea09
Author | SHA1 | Date | |
---|---|---|---|
|
a5f371ea09 | ||
|
5661c20580 | ||
|
7897e86bcc | ||
|
8e0e0f1a3b | ||
|
0a4b72f8f6 | ||
|
4f6712e3b3 |
17
Cargo.lock
generated
17
Cargo.lock
generated
@ -748,9 +748,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.0"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc"
|
||||
checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"libz-rs-sys",
|
||||
@ -1469,9 +1469,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libz-rs-sys"
|
||||
version = "0.4.2"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d"
|
||||
checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221"
|
||||
dependencies = [
|
||||
"zlib-rs",
|
||||
]
|
||||
@ -3932,13 +3932,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "2.5.0"
|
||||
version = "4.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27c03817464f64e23f6f37574b4fdc8cf65925b5bfd2b0f2aedf959791941f88"
|
||||
checksum = "9aed4ac33e8eb078c89e6cbb1d5c4c7703ec6d299fc3e7c3695af8f8b423468b"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"crc32fast",
|
||||
"crossbeam-utils",
|
||||
"flate2",
|
||||
"indexmap 2.7.1",
|
||||
"memchr",
|
||||
@ -3947,9 +3946,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zlib-rs"
|
||||
version = "0.4.2"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05"
|
||||
checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a"
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
|
@ -143,7 +143,7 @@ xmlparser = "0.13.5"
|
||||
xmlwriter = "0.1.0"
|
||||
xz2 = { version = "0.1", features = ["static"] }
|
||||
yaml-front-matter = "0.1"
|
||||
zip = { version = "2.5", default-features = false, features = ["deflate"] }
|
||||
zip = { version = "4.3", default-features = false, features = ["deflate"] }
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 2
|
||||
|
@ -14,8 +14,8 @@ use typst_library::model::{
|
||||
RefElem, StrongElem, TableCell, TableElem, TermsElem,
|
||||
};
|
||||
use typst_library::text::{
|
||||
HighlightElem, LinebreakElem, OverlineElem, RawElem, RawLine, SpaceElem, StrikeElem,
|
||||
SubElem, SuperElem, UnderlineElem,
|
||||
HighlightElem, LinebreakElem, OverlineElem, RawElem, RawLine, SmallcapsElem,
|
||||
SpaceElem, StrikeElem, SubElem, SuperElem, UnderlineElem,
|
||||
};
|
||||
use typst_library::visualize::ImageElem;
|
||||
|
||||
@ -47,6 +47,7 @@ pub fn register(rules: &mut NativeRuleMap) {
|
||||
rules.register(Html, OVERLINE_RULE);
|
||||
rules.register(Html, STRIKE_RULE);
|
||||
rules.register(Html, HIGHLIGHT_RULE);
|
||||
rules.register(Html, SMALLCAPS_RULE);
|
||||
rules.register(Html, RAW_RULE);
|
||||
rules.register(Html, RAW_LINE_RULE);
|
||||
|
||||
@ -59,19 +60,11 @@ pub fn register(rules: &mut NativeRuleMap) {
|
||||
rules.register::<FrameElem>(Paged, |elem, _, _| Ok(elem.body.clone()));
|
||||
}
|
||||
|
||||
const STRONG_RULE: ShowFn<StrongElem> = |elem, _, _| {
|
||||
Ok(HtmlElem::new(tag::strong)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
};
|
||||
const STRONG_RULE: ShowFn<StrongElem> =
|
||||
|elem, _, _| Ok(HtmlElem::new(tag::strong).with_body(Some(elem.body.clone())).pack());
|
||||
|
||||
const EMPH_RULE: ShowFn<EmphElem> = |elem, _, _| {
|
||||
Ok(HtmlElem::new(tag::em)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
};
|
||||
const EMPH_RULE: ShowFn<EmphElem> =
|
||||
|elem, _, _| Ok(HtmlElem::new(tag::em).with_body(Some(elem.body.clone())).pack());
|
||||
|
||||
const LIST_RULE: ShowFn<ListElem> = |elem, _, styles| {
|
||||
Ok(HtmlElem::new(tag::ul)
|
||||
@ -86,8 +79,7 @@ const LIST_RULE: ShowFn<ListElem> = |elem, _, styles| {
|
||||
.pack()
|
||||
.spanned(item.span())
|
||||
}))))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const ENUM_RULE: ShowFn<EnumElem> = |elem, _, styles| {
|
||||
@ -114,7 +106,7 @@ const ENUM_RULE: ShowFn<EnumElem> = |elem, _, styles| {
|
||||
li.with_body(Some(body)).pack().spanned(item.span())
|
||||
}));
|
||||
|
||||
Ok(ol.with_body(Some(body)).pack().spanned(elem.span()))
|
||||
Ok(ol.with_body(Some(body)).pack())
|
||||
};
|
||||
|
||||
const TERMS_RULE: ShowFn<TermsElem> = |elem, _, styles| {
|
||||
@ -166,8 +158,7 @@ const LINK_RULE: ShowFn<LinkElem> = |elem, engine, _| {
|
||||
Ok(HtmlElem::new(tag::a)
|
||||
.with_optional_attr(attr::href, href)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const HEADING_RULE: ShowFn<HeadingElem> = |elem, engine, styles| {
|
||||
@ -203,10 +194,9 @@ const HEADING_RULE: ShowFn<HeadingElem> = |elem, engine, styles| {
|
||||
.with_attr(attr::role, "heading")
|
||||
.with_attr(attr::aria_level, eco_format!("{}", level + 1))
|
||||
.pack()
|
||||
.spanned(span)
|
||||
} else {
|
||||
let t = [tag::h2, tag::h3, tag::h4, tag::h5, tag::h6][level - 1];
|
||||
HtmlElem::new(t).with_body(Some(realized)).pack().spanned(span)
|
||||
HtmlElem::new(t).with_body(Some(realized)).pack()
|
||||
})
|
||||
};
|
||||
|
||||
@ -225,17 +215,13 @@ const FIGURE_RULE: ShowFn<FigureElem> = |elem, _, styles| {
|
||||
// Ensure that the body is considered a paragraph.
|
||||
realized += ParbreakElem::shared().clone().spanned(span);
|
||||
|
||||
Ok(HtmlElem::new(tag::figure)
|
||||
.with_body(Some(realized))
|
||||
.pack()
|
||||
.spanned(span))
|
||||
Ok(HtmlElem::new(tag::figure).with_body(Some(realized)).pack())
|
||||
};
|
||||
|
||||
const FIGURE_CAPTION_RULE: ShowFn<FigureCaption> = |elem, engine, styles| {
|
||||
Ok(HtmlElem::new(tag::figcaption)
|
||||
.with_body(Some(elem.realize(engine, styles)?))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const QUOTE_RULE: ShowFn<QuoteElem> = |elem, _, styles| {
|
||||
@ -376,19 +362,11 @@ fn show_cell(tag: HtmlTag, cell: &Cell, styles: StyleChain) -> Content {
|
||||
.spanned(cell.span())
|
||||
}
|
||||
|
||||
const SUB_RULE: ShowFn<SubElem> = |elem, _, _| {
|
||||
Ok(HtmlElem::new(tag::sub)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
};
|
||||
const SUB_RULE: ShowFn<SubElem> =
|
||||
|elem, _, _| Ok(HtmlElem::new(tag::sub).with_body(Some(elem.body.clone())).pack());
|
||||
|
||||
const SUPER_RULE: ShowFn<SuperElem> = |elem, _, _| {
|
||||
Ok(HtmlElem::new(tag::sup)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
};
|
||||
const SUPER_RULE: ShowFn<SuperElem> =
|
||||
|elem, _, _| Ok(HtmlElem::new(tag::sup).with_body(Some(elem.body.clone())).pack());
|
||||
|
||||
const UNDERLINE_RULE: ShowFn<UnderlineElem> = |elem, _, _| {
|
||||
// Note: In modern HTML, `<u>` is not the underline element, but
|
||||
@ -413,6 +391,20 @@ const STRIKE_RULE: ShowFn<StrikeElem> =
|
||||
const HIGHLIGHT_RULE: ShowFn<HighlightElem> =
|
||||
|elem, _, _| Ok(HtmlElem::new(tag::mark).with_body(Some(elem.body.clone())).pack());
|
||||
|
||||
const SMALLCAPS_RULE: ShowFn<SmallcapsElem> = |elem, _, styles| {
|
||||
Ok(HtmlElem::new(tag::span)
|
||||
.with_attr(
|
||||
attr::style,
|
||||
if elem.all.get(styles) {
|
||||
"font-variant-caps: all-small-caps"
|
||||
} else {
|
||||
"font-variant-caps: small-caps"
|
||||
},
|
||||
)
|
||||
.with_body(Some(elem.body.clone()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const RAW_RULE: ShowFn<RawElem> = |elem, _, styles| {
|
||||
let lines = elem.lines.as_deref().unwrap_or_default();
|
||||
|
||||
@ -427,8 +419,7 @@ const RAW_RULE: ShowFn<RawElem> = |elem, _, styles| {
|
||||
|
||||
Ok(HtmlElem::new(if elem.block.get(styles) { tag::pre } else { tag::code })
|
||||
.with_body(Some(Content::sequence(seq)))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const RAW_LINE_RULE: ShowFn<RawLine> = |elem, _, _| Ok(elem.body.clone());
|
||||
|
@ -272,7 +272,7 @@ const HEADING_RULE: ShowFn<HeadingElem> = |elem, engine, styles| {
|
||||
BlockElem::new().with_body(Some(BlockBody::Content(realized)))
|
||||
};
|
||||
|
||||
Ok(block.pack().spanned(span))
|
||||
Ok(block.pack())
|
||||
};
|
||||
|
||||
const FIGURE_RULE: ShowFn<FigureElem> = |elem, _, styles| {
|
||||
@ -326,8 +326,7 @@ const FIGURE_RULE: ShowFn<FigureElem> = |elem, _, styles| {
|
||||
const FIGURE_CAPTION_RULE: ShowFn<FigureCaption> = |elem, engine, styles| {
|
||||
Ok(BlockElem::new()
|
||||
.with_body(Some(BlockBody::Content(elem.realize(engine, styles)?)))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const QUOTE_RULE: ShowFn<QuoteElem> = |elem, _, styles| {
|
||||
@ -550,9 +549,7 @@ const BIBLIOGRAPHY_RULE: ShowFn<BibliographyElem> = |elem, engine, styles| {
|
||||
};
|
||||
|
||||
const TABLE_RULE: ShowFn<TableElem> = |elem, _, _| {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::grid::layout_table)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::grid::layout_table).pack())
|
||||
};
|
||||
|
||||
const TABLE_CELL_RULE: ShowFn<TableCell> = |elem, _, styles| {
|
||||
@ -703,27 +700,19 @@ const ALIGN_RULE: ShowFn<AlignElem> =
|
||||
|elem, _, styles| Ok(elem.body.clone().aligned(elem.alignment.get(styles)));
|
||||
|
||||
const PAD_RULE: ShowFn<PadElem> = |elem, _, _| {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::pad::layout_pad)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::pad::layout_pad).pack())
|
||||
};
|
||||
|
||||
const COLUMNS_RULE: ShowFn<ColumnsElem> = |elem, _, _| {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::flow::layout_columns)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::flow::layout_columns).pack())
|
||||
};
|
||||
|
||||
const STACK_RULE: ShowFn<StackElem> = |elem, _, _| {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::stack::layout_stack)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::stack::layout_stack).pack())
|
||||
};
|
||||
|
||||
const GRID_RULE: ShowFn<GridElem> = |elem, _, _| {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::grid::layout_grid)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::grid::layout_grid).pack())
|
||||
};
|
||||
|
||||
const GRID_CELL_RULE: ShowFn<GridCell> = |elem, _, styles| {
|
||||
@ -753,33 +742,23 @@ fn show_cell(
|
||||
}
|
||||
|
||||
const MOVE_RULE: ShowFn<MoveElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_move)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_move).pack())
|
||||
};
|
||||
|
||||
const SCALE_RULE: ShowFn<ScaleElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_scale)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_scale).pack())
|
||||
};
|
||||
|
||||
const ROTATE_RULE: ShowFn<RotateElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_rotate)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_rotate).pack())
|
||||
};
|
||||
|
||||
const SKEW_RULE: ShowFn<SkewElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_skew)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::transforms::layout_skew).pack())
|
||||
};
|
||||
|
||||
const REPEAT_RULE: ShowFn<RepeatElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::repeat::layout_repeat)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::repeat::layout_repeat).pack())
|
||||
};
|
||||
|
||||
const HIDE_RULE: ShowFn<HideElem> =
|
||||
@ -801,83 +780,66 @@ const LAYOUT_RULE: ShowFn<LayoutElem> = |elem, _, _| {
|
||||
crate::flow::layout_fragment(engine, &result, locator, styles, regions)
|
||||
},
|
||||
)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const IMAGE_RULE: ShowFn<ImageElem> = |elem, _, styles| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::image::layout_image)
|
||||
.with_width(elem.width.get(styles))
|
||||
.with_height(elem.height.get(styles))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const LINE_RULE: ShowFn<LineElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_line)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_line).pack())
|
||||
};
|
||||
|
||||
const RECT_RULE: ShowFn<RectElem> = |elem, _, styles| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_rect)
|
||||
.with_width(elem.width.get(styles))
|
||||
.with_height(elem.height.get(styles))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const SQUARE_RULE: ShowFn<SquareElem> = |elem, _, styles| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_square)
|
||||
.with_width(elem.width.get(styles))
|
||||
.with_height(elem.height.get(styles))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const ELLIPSE_RULE: ShowFn<EllipseElem> = |elem, _, styles| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_ellipse)
|
||||
.with_width(elem.width.get(styles))
|
||||
.with_height(elem.height.get(styles))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const CIRCLE_RULE: ShowFn<CircleElem> = |elem, _, styles| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_circle)
|
||||
.with_width(elem.width.get(styles))
|
||||
.with_height(elem.height.get(styles))
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
};
|
||||
|
||||
const POLYGON_RULE: ShowFn<PolygonElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_polygon)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_polygon).pack())
|
||||
};
|
||||
|
||||
const CURVE_RULE: ShowFn<CurveElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_curve)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_curve).pack())
|
||||
};
|
||||
|
||||
const PATH_RULE: ShowFn<PathElem> = |elem, _, _| {
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_path)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(BlockElem::single_layouter(elem.clone(), crate::shapes::layout_path).pack())
|
||||
};
|
||||
|
||||
const EQUATION_RULE: ShowFn<EquationElem> = |elem, _, styles| {
|
||||
if elem.block.get(styles) {
|
||||
Ok(BlockElem::multi_layouter(elem.clone(), crate::math::layout_equation_block)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
.pack())
|
||||
} else {
|
||||
Ok(InlineElem::layouter(elem.clone(), crate::math::layout_equation_inline)
|
||||
.pack()
|
||||
.spanned(elem.span()))
|
||||
Ok(InlineElem::layouter(elem.clone(), crate::math::layout_equation_inline).pack())
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -37,13 +37,12 @@ pub use crate::__select_where as select_where;
|
||||
|
||||
/// A filter for selecting elements within the document.
|
||||
///
|
||||
/// You can construct a selector in the following ways:
|
||||
/// - you can use an element [function]
|
||||
/// - you can filter for an element function with
|
||||
/// [specific fields]($function.where)
|
||||
/// - you can use a [string]($str) or [regular expression]($regex)
|
||||
/// - you can use a [`{<label>}`]($label)
|
||||
/// - you can use a [`location`]
|
||||
/// To construct a selector you can:
|
||||
/// - use an element [function]
|
||||
/// - filter for an element function with [specific fields]($function.where)
|
||||
/// - use a [string]($str) or [regular expression]($regex)
|
||||
/// - use a [`{<label>}`]($label)
|
||||
/// - use a [`location`]
|
||||
/// - call the [`selector`] constructor to convert any of the above types into a
|
||||
/// selector value and use the methods below to refine it
|
||||
///
|
||||
@ -148,7 +147,9 @@ impl Selector {
|
||||
impl Selector {
|
||||
/// Turns a value into a selector. The following values are accepted:
|
||||
/// - An element function like a `heading` or `figure`.
|
||||
/// - A [string]($str) or [regular expression]($regex).
|
||||
/// - A `{<label>}`.
|
||||
/// - A [`location`].
|
||||
/// - A more complex selector like `{heading.where(level: 1)}`.
|
||||
#[func(constructor)]
|
||||
pub fn construct(
|
||||
|
@ -374,7 +374,11 @@ fn visit_show_rules<'a>(
|
||||
}
|
||||
|
||||
// Apply a built-in show rule.
|
||||
ShowStep::Builtin(rule) => rule.apply(&output, s.engine, chained),
|
||||
ShowStep::Builtin(rule) => {
|
||||
let _scope = typst_timing::TimingScope::new(output.elem().name());
|
||||
rule.apply(&output, s.engine, chained)
|
||||
.map(|content| content.spanned(output.span()))
|
||||
}
|
||||
};
|
||||
|
||||
// Errors in show rules don't terminate compilation immediately. We just
|
||||
|
@ -7,5 +7,6 @@
|
||||
<body>
|
||||
<p><s>Struck</s> <mark>Highlighted</mark> <span style="text-decoration: underline">Underlined</span> <span style="text-decoration: overline">Overlined</span></p>
|
||||
<p><span style="text-decoration: overline"><span style="text-decoration: underline"><mark><s>Mixed</s></mark></span></span></p>
|
||||
<p><span style="font-variant-caps: small-caps">Small Caps</span> <span style="font-variant-caps: all-small-caps">All Small Caps</span></p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -91,3 +91,6 @@ We can also specify a customized value
|
||||
#overline[Overlined]
|
||||
|
||||
#(strike, highlight, underline, overline).fold([Mixed], (it, f) => f(it))
|
||||
|
||||
#smallcaps[Small Caps]
|
||||
#smallcaps(all: true)[All Small Caps]
|
||||
|
Loading…
x
Reference in New Issue
Block a user