summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorYip Coekjan <69834864+Coekjan@users.noreply.github.com>2024-09-08 16:29:58 +0800
committerGitHub <noreply@github.com>2024-09-08 08:29:58 +0000
commit40fcd97d584fc1dfa6446bc4922d3b1e440e0afd (patch)
tree29d0439aad5fc5a0301f058c7153cfc4b74a30b9 /crates
parent4cddb485847e01f62cc1fe65d37028a87df52daa (diff)
Make `QuoteElem` locatable (#4909)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/introspection/location.rs8
-rw-r--r--crates/typst/src/model/quote.rs3
2 files changed, 6 insertions, 5 deletions
diff --git a/crates/typst/src/introspection/location.rs b/crates/typst/src/introspection/location.rs
index 5cd6aae0..70076bca 100644
--- a/crates/typst/src/introspection/location.rs
+++ b/crates/typst/src/introspection/location.rs
@@ -17,10 +17,10 @@ use crate::model::Numbering;
///
/// # Locatable elements { #locatable }
/// Currently, only a subset of element functions is locatable. Aside from
-/// headings and figures, this includes equations, references and all elements
-/// with an explicit label. As a result, you _can_ query for e.g. [`strong`]
-/// elements, but you will find only those that have an explicit label attached
-/// to them. This limitation will be resolved in the future.
+/// headings and figures, this includes equations, references, quotes and all
+/// elements with an explicit label. As a result, you _can_ query for e.g.
+/// [`strong`] elements, but you will find only those that have an explicit
+/// label attached to them. This limitation will be resolved in the future.
#[ty(scope)]
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
pub struct Location(u128);
diff --git a/crates/typst/src/model/quote.rs b/crates/typst/src/model/quote.rs
index ff6ae110..160d96d6 100644
--- a/crates/typst/src/model/quote.rs
+++ b/crates/typst/src/model/quote.rs
@@ -4,6 +4,7 @@ use crate::foundations::{
cast, elem, Content, Depth, Label, NativeElement, Packed, Show, ShowSet, Smart,
StyleChain, Styles,
};
+use crate::introspection::Locatable;
use crate::layout::{
Alignment, BlockChild, BlockElem, Em, HElem, PadElem, Spacing, VElem,
};
@@ -42,7 +43,7 @@ use crate::text::{SmartQuoteElem, SmartQuotes, SpaceElem, TextElem};
/// flame of Udûn. Go back to the Shadow! You cannot pass.
/// ]
/// ```
-#[elem(ShowSet, Show)]
+#[elem(Locatable, ShowSet, Show)]
pub struct QuoteElem {
/// Whether this is a block quote.
///