mirror of
https://github.com/typst/typst
synced 2025-07-28 14:57:54 +08:00
Skip locatables
This commit is contained in:
parent
70386c10f7
commit
34116cddf6
@ -10,7 +10,7 @@ use typst_utils::NonZeroExt;
|
|||||||
|
|
||||||
use crate::diag::{bail, StrResult};
|
use crate::diag::{bail, StrResult};
|
||||||
use crate::foundations::{Content, Label, Repr, Selector};
|
use crate::foundations::{Content, Label, Repr, Selector};
|
||||||
use crate::introspection::{Location, Tag};
|
use crate::introspection::{Locatable, Location, Tag};
|
||||||
use crate::layout::{Frame, FrameItem, Point, Position, Transform};
|
use crate::layout::{Frame, FrameItem, Point, Position, Transform};
|
||||||
use crate::model::Numbering;
|
use crate::model::Numbering;
|
||||||
|
|
||||||
@ -422,11 +422,13 @@ impl IntrospectorBuilder {
|
|||||||
) {
|
) {
|
||||||
match tag {
|
match tag {
|
||||||
Tag::Start(elem) => {
|
Tag::Start(elem) => {
|
||||||
|
if elem.can::<dyn Locatable>() {
|
||||||
let loc = elem.location().unwrap();
|
let loc = elem.location().unwrap();
|
||||||
if self.seen.insert(loc) {
|
if self.seen.insert(loc) {
|
||||||
sink.push((elem.clone(), position));
|
sink.push((elem.clone(), position));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Tag::End(loc, key) => {
|
Tag::End(loc, key) => {
|
||||||
self.keys.insert(*key, *loc);
|
self.keys.insert(*key, *loc);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user