mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Make some changes that were deferred until after 0.11 (#3934)
This commit is contained in:
parent
f25874640e
commit
401ba82927
@ -126,7 +126,6 @@ impl Selector {
|
||||
pub fn matches(&self, target: &Content, styles: Option<StyleChain>) -> 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)
|
||||
|
@ -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(<note>).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<MetadataElem> {
|
||||
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<MetadataElem> {
|
||||
fn behaviour(&self) -> Behaviour {
|
||||
Behaviour::Invisible
|
||||
}
|
||||
}
|
||||
|
@ -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::<MetaElem>() {
|
||||
// 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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user