Skip to content

Commit

Permalink
Take a deep copy of name when tagging
Browse files Browse the repository at this point in the history
Seems I need to do this to get Pod::To::PDF::API::Sync working
reliably across threads.
  • Loading branch information
dwarring committed Aug 20, 2024
1 parent 23e2217 commit 5262863
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/PDF/Tags/Attr.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ use PDF::Tags::Node::Parent;
use Method::Also;

has PDF::Tags::Node::Parent $.parent is rw;
submethod TWEAK(Pair :$cos!) {
submethod TWEAK(Pair:D :$cos!) {
self.set-cos($cos);
}
method xpath {
my Str $xpath = .xpath with $!parent;
$xpath ~= '@' ~ self.name;
$xpath;
$xpath ~ '@' ~ self.name;
}
multi sub to-str(@a) { @a».Str.join: ' '}
multi sub to-str($_) { .Str}
Expand Down
2 changes: 1 addition & 1 deletion lib/PDF/Tags/Elem.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ submethod TWEAK(Str :$Alt, Str :$ActualText, Str :$Lang, Str :$class, :%attribut
method mark(PDF::Tags::Elem:D $elem: PDF::Content $gfx, &action, :$name = self.name, |c --> PDF::Tags::Mark:D) {
temp $gfx.actual-text = ''; # Populated by PDF::Content.print()

my PDF::Content::Tag $cos = $gfx.tag($name, &action, :mark, |c);
my PDF::Content::Tag $cos = $gfx.tag($name.fmt, &action, :mark, |c);
my PDF::Tags::Mark:D $mark = $elem.add-kid: :$cos;
$mark.actual-text = $gfx.actual-text;
# Register this mark in the parent tree
Expand Down

0 comments on commit 5262863

Please sign in to comment.