mirror of
https://github.com/typst/typst
synced 2025-07-27 14:27:56 +08:00
feat: generate tags for quotes
This commit is contained in:
parent
bc09df0c8b
commit
66ca4dc9a0
@ -20,7 +20,8 @@ use typst_library::introspection::Location;
|
|||||||
use typst_library::layout::RepeatElem;
|
use typst_library::layout::RepeatElem;
|
||||||
use typst_library::model::{
|
use typst_library::model::{
|
||||||
Destination, EnumElem, FigureCaption, FigureElem, FootnoteElem, FootnoteEntry,
|
Destination, EnumElem, FigureCaption, FigureElem, FootnoteElem, FootnoteEntry,
|
||||||
HeadingElem, ListElem, Outlinable, OutlineEntry, TableCell, TableElem, TermsElem,
|
HeadingElem, ListElem, Outlinable, OutlineEntry, QuoteElem, TableCell, TableElem,
|
||||||
|
TermsElem,
|
||||||
};
|
};
|
||||||
use typst_library::pdf::{ArtifactElem, ArtifactKind, PdfMarkerTag, PdfMarkerTagKind};
|
use typst_library::pdf::{ArtifactElem, ArtifactKind, PdfMarkerTag, PdfMarkerTagKind};
|
||||||
use typst_library::visualize::ImageElem;
|
use typst_library::visualize::ImageElem;
|
||||||
@ -150,6 +151,13 @@ pub(crate) fn handle_start(
|
|||||||
let footnote_loc = entry.note.location().unwrap();
|
let footnote_loc = entry.note.location().unwrap();
|
||||||
push_stack(gc, loc, StackEntryKind::FootNoteEntry(footnote_loc))?;
|
push_stack(gc, loc, StackEntryKind::FootNoteEntry(footnote_loc))?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
} else if let Some(quote) = elem.to_packed::<QuoteElem>() {
|
||||||
|
// TODO: should the attribution be handled somehow?
|
||||||
|
if quote.block.get(StyleChain::default()) {
|
||||||
|
TagKind::BlockQuote.into()
|
||||||
|
} else {
|
||||||
|
TagKind::InlineQuote.into()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user