mirror of
https://github.com/typst/typst
synced 2025-07-27 22:37:54 +08:00
Compare commits
3 Commits
34b1be9151
...
187dcc4d3a
Author | SHA1 | Date | |
---|---|---|---|
|
187dcc4d3a | ||
|
5d91145ae3 | ||
|
53d8d3f998 |
@ -30,6 +30,7 @@ use crate::foundations::{
|
|||||||
RecipeIndex, Repr, Selector, Str, Style, StyleChain, Styles, Value,
|
RecipeIndex, Repr, Selector, Str, Style, StyleChain, Styles, Value,
|
||||||
};
|
};
|
||||||
use crate::introspection::Location;
|
use crate::introspection::Location;
|
||||||
|
use crate::introspection::Unlocatable;
|
||||||
use crate::layout::{AlignElem, Alignment, Axes, Length, MoveElem, PadElem, Rel, Sides};
|
use crate::layout::{AlignElem, Alignment, Axes, Length, MoveElem, PadElem, Rel, Sides};
|
||||||
use crate::model::{Destination, EmphElem, LinkElem, StrongElem};
|
use crate::model::{Destination, EmphElem, LinkElem, StrongElem};
|
||||||
use crate::text::UnderlineElem;
|
use crate::text::UnderlineElem;
|
||||||
@ -705,7 +706,7 @@ impl Serialize for Content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A sequence of content.
|
/// A sequence of content.
|
||||||
#[elem(Debug, Repr)]
|
#[elem(Debug, Repr, Unlocatable)]
|
||||||
pub struct SequenceElem {
|
pub struct SequenceElem {
|
||||||
/// The elements.
|
/// The elements.
|
||||||
#[required]
|
#[required]
|
||||||
@ -719,6 +720,8 @@ impl Debug for SequenceElem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Unlocatable for Packed<SequenceElem> {}
|
||||||
|
|
||||||
// Derive is currently incompatible with `elem` macro.
|
// Derive is currently incompatible with `elem` macro.
|
||||||
#[allow(clippy::derivable_impls)]
|
#[allow(clippy::derivable_impls)]
|
||||||
impl Default for SequenceElem {
|
impl Default for SequenceElem {
|
||||||
@ -742,7 +745,7 @@ impl Repr for SequenceElem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Content alongside styles.
|
/// Content alongside styles.
|
||||||
#[elem(Debug, Repr, PartialEq)]
|
#[elem(Debug, Repr, PartialEq, Unlocatable)]
|
||||||
pub struct StyledElem {
|
pub struct StyledElem {
|
||||||
/// The content.
|
/// The content.
|
||||||
#[required]
|
#[required]
|
||||||
@ -761,6 +764,8 @@ impl Debug for StyledElem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Unlocatable for Packed<StyledElem> {}
|
||||||
|
|
||||||
impl PartialEq for StyledElem {
|
impl PartialEq for StyledElem {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
self.child == other.child
|
self.child == other.child
|
||||||
|
@ -13,6 +13,7 @@ use crate::foundations::{
|
|||||||
cast, elem, func, scope, ty, Array, Content, Func, NativeElement, NativeFunc, Packed,
|
cast, elem, func, scope, ty, Array, Content, Func, NativeElement, NativeFunc, Packed,
|
||||||
PlainText, Repr as _,
|
PlainText, Repr as _,
|
||||||
};
|
};
|
||||||
|
use crate::introspection::Unlocatable;
|
||||||
|
|
||||||
/// A Unicode symbol.
|
/// A Unicode symbol.
|
||||||
///
|
///
|
||||||
@ -413,7 +414,7 @@ impl<'a> Iterator for Variants<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A single character.
|
/// A single character.
|
||||||
#[elem(Repr, PlainText)]
|
#[elem(Repr, PlainText, Unlocatable)]
|
||||||
pub struct SymbolElem {
|
pub struct SymbolElem {
|
||||||
/// The symbol's character.
|
/// The symbol's character.
|
||||||
#[required]
|
#[required]
|
||||||
@ -439,3 +440,5 @@ impl crate::foundations::Repr for SymbolElem {
|
|||||||
eco_format!("[{}]", self.text)
|
eco_format!("[{}]", self.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Unlocatable for Packed<SymbolElem> {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user