diff --git a/crates/typst/src/foundations/selector.rs b/crates/typst/src/foundations/selector.rs index 90663500e..d41fd2dc8 100644 --- a/crates/typst/src/foundations/selector.rs +++ b/crates/typst/src/foundations/selector.rs @@ -126,7 +126,6 @@ impl Selector { pub fn matches(&self, target: &Content, styles: Option) -> bool { match self { Self::Elem(element, dict) => { - // TODO: Optimize field access to not clone. target.func() == *element && dict.iter().flat_map(|dict| dict.iter()).all(|(id, value)| { target.get(*id, styles).as_ref() == Some(value) diff --git a/crates/typst/src/introspection/metadata.rs b/crates/typst/src/introspection/metadata.rs index 2d6d8953f..3a923308a 100644 --- a/crates/typst/src/introspection/metadata.rs +++ b/crates/typst/src/introspection/metadata.rs @@ -2,7 +2,6 @@ use crate::diag::SourceResult; use crate::engine::Engine; use crate::foundations::{elem, Content, Packed, Show, StyleChain, Value}; use crate::introspection::Locatable; -use crate::realize::{Behave, Behaviour}; /// Exposes a value to the query system without producing visible content. /// @@ -24,7 +23,7 @@ use crate::realize::{Behave, Behaviour}; /// query().first().value /// } /// ``` -#[elem(Behave, Show, Locatable)] +#[elem(Show, Locatable)] pub struct MetadataElem { /// The value to embed into the document. #[required] @@ -36,11 +35,3 @@ impl Show for Packed { Ok(Content::empty()) } } - -// TODO: Metadata shows as empty content, so this behaviour is unnecessary. It -// can be removed once 0.11 has landed. -impl Behave for Packed { - fn behaviour(&self) -> Behaviour { - Behaviour::Invisible - } -} diff --git a/crates/typst/src/realize/mod.rs b/crates/typst/src/realize/mod.rs index 69a961b06..99b12a18d 100644 --- a/crates/typst/src/realize/mod.rs +++ b/crates/typst/src/realize/mod.rs @@ -416,10 +416,7 @@ struct ParBuilder<'a>(BehavedBuilder<'a>); impl<'a> ParBuilder<'a> { fn accept(&mut self, content: &'a Content, styles: StyleChain<'a>) -> bool { if content.is::() { - // TODO: This could probably just be `self.0.is_empty()` since no - // weak or invisible elements can be at the start of the builder. It - // can be removed once 0.11 has landed. - if self.0.has_strong_elements(false) { + if !self.0.is_empty() { self.0.push(content, styles); return true; } diff --git a/tests/suite/layout/container.typ b/tests/suite/layout/container.typ index ede051dba..b38f6b250 100644 --- a/tests/suite/layout/container.typ +++ b/tests/suite/layout/container.typ @@ -67,7 +67,6 @@ There --- block-spacing-table --- // Test that paragraph spacing loses against block spacing. -// TODO #set block(spacing: 100pt) #show table: set block(above: 5pt, below: 5pt) Hello