Skip to content

Commit

Permalink
Suppress writing of structural artifacts
Browse files Browse the repository at this point in the history
PDF 2.0 spec makes it clearer that these can be in the structure
tree as well as at the content level.
  • Loading branch information
dwarring committed Nov 14, 2023
1 parent 4f4e6c1 commit e2d2436
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/PDF/Tags/XML-Writer.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ has Bool $.fields = True;
has Bool $.valid = !$!marks && !$!roles;
has Str $.omit;
has Str $.root-tag;
has Bool $.artifacts = False;
has Bool $!got-nl = True;
has Bool $!feed;
has Bool $!snug = True;
Expand Down Expand Up @@ -221,6 +222,7 @@ multi method stream-xml(PDF::Tags::Elem $node, UInt :$depth is copy = 0) {
atts-str(%attributes);
} // '';
$name = $_ with $role;
return if $name eq 'Artifact' && !$!artifacts;
my $omit-tag = $name ~~ $_ with $!omit;
if $depth >= $!max-depth {
Expand Down

0 comments on commit e2d2436

Please sign in to comment.