diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-07-09 10:16:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 08:16:36 +0000 |
| commit | e5e1dcd9c01341d2cd3473ac94a70223d5966086 (patch) | |
| tree | d648efad9463cb10270d55ba35210eeb1e91ee22 /crates/typst-library/src/pdf | |
| parent | 0a3c6939dd274f40672484695d909c2cc0d0d755 (diff) | |
Target-specific native show rules (#6569)
Diffstat (limited to 'crates/typst-library/src/pdf')
| -rw-r--r-- | crates/typst-library/src/pdf/embed.rs | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/crates/typst-library/src/pdf/embed.rs b/crates/typst-library/src/pdf/embed.rs index 0f93f95a..3aba8562 100644 --- a/crates/typst-library/src/pdf/embed.rs +++ b/crates/typst-library/src/pdf/embed.rs @@ -1,12 +1,8 @@ use ecow::EcoString; -use typst_library::foundations::Target; use typst_syntax::Spanned; -use crate::diag::{warning, At, SourceResult}; -use crate::engine::Engine; -use crate::foundations::{ - elem, Bytes, Cast, Content, Derived, Packed, Show, StyleChain, TargetElem, -}; +use crate::diag::At; +use crate::foundations::{elem, Bytes, Cast, Derived}; use crate::introspection::Locatable; use crate::World; @@ -33,7 +29,7 @@ use crate::World; /// - This element is ignored if exporting to a format other than PDF. /// - File embeddings are not currently supported for PDF/A-2, even if the /// embedded file conforms to PDF/A-1 or PDF/A-2. -#[elem(Show, Locatable)] +#[elem(Locatable)] pub struct EmbedElem { /// The [path]($syntax/#paths) of the file to be embedded. /// @@ -77,17 +73,6 @@ pub struct EmbedElem { pub description: Option<EcoString>, } -impl Show for Packed<EmbedElem> { - fn show(&self, engine: &mut Engine, styles: StyleChain) -> SourceResult<Content> { - if styles.get(TargetElem::target) == Target::Html { - engine - .sink - .warn(warning!(self.span(), "embed was ignored during HTML export")); - } - Ok(Content::empty()) - } -} - /// The relationship of an embedded file with the document. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)] pub enum EmbeddedFileRelationship { |
