Compare commits

...

3 Commits

Author SHA1 Message Date
Laurenz
187dcc4d3a More unlocatables 2025-07-19 10:25:48 +02:00
Laurenz
5d91145ae3 Revert "Print elements"
This reverts commit 53d8d3f998885466b363459863101bb63a6ff539.
2025-07-19 10:24:07 +02:00
Laurenz
53d8d3f998 Print elements 2025-07-19 10:24:05 +02:00
2 changed files with 11 additions and 3 deletions

View File

@ -30,6 +30,7 @@ use crate::foundations::{
RecipeIndex, Repr, Selector, Str, Style, StyleChain, Styles, Value,
};
use crate::introspection::Location;
use crate::introspection::Unlocatable;
use crate::layout::{AlignElem, Alignment, Axes, Length, MoveElem, PadElem, Rel, Sides};
use crate::model::{Destination, EmphElem, LinkElem, StrongElem};
use crate::text::UnderlineElem;
@ -705,7 +706,7 @@ impl Serialize for Content {
}
/// A sequence of content.
#[elem(Debug, Repr)]
#[elem(Debug, Repr, Unlocatable)]
pub struct SequenceElem {
/// The elements.
#[required]
@ -719,6 +720,8 @@ impl Debug for SequenceElem {
}
}
impl Unlocatable for Packed<SequenceElem> {}
// Derive is currently incompatible with `elem` macro.
#[allow(clippy::derivable_impls)]
impl Default for SequenceElem {
@ -742,7 +745,7 @@ impl Repr for SequenceElem {
}
/// Content alongside styles.
#[elem(Debug, Repr, PartialEq)]
#[elem(Debug, Repr, PartialEq, Unlocatable)]
pub struct StyledElem {
/// The content.
#[required]
@ -761,6 +764,8 @@ impl Debug for StyledElem {
}
}
impl Unlocatable for Packed<StyledElem> {}
impl PartialEq for StyledElem {
fn eq(&self, other: &Self) -> bool {
self.child == other.child

View File

@ -13,6 +13,7 @@ use crate::foundations::{
cast, elem, func, scope, ty, Array, Content, Func, NativeElement, NativeFunc, Packed,
PlainText, Repr as _,
};
use crate::introspection::Unlocatable;
/// A Unicode symbol.
///
@ -413,7 +414,7 @@ impl<'a> Iterator for Variants<'a> {
}
/// A single character.
#[elem(Repr, PlainText)]
#[elem(Repr, PlainText, Unlocatable)]
pub struct SymbolElem {
/// The symbol's character.
#[required]
@ -439,3 +440,5 @@ impl crate::foundations::Repr for SymbolElem {
eco_format!("[{}]", self.text)
}
}
impl Unlocatable for Packed<SymbolElem> {}