Skip to content

Commit

Permalink
tweak Span tag/--omit option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Nov 6, 2023
1 parent a9cf5f1 commit a6947c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
DocProj=pdf-raku.github.io
DocRepo=https://github.com/pdf-raku/$(DocProj)
DocLinker=../$(DocProj)/etc/resolve-links.raku
TEST_JOBS ?= 6

all : doc

test :
@prove -e"raku -I ." t
@prove6 -I . -j $(TEST_JOBS) t

loudtest :
@prove -e"raku -I ." -v t
@prove6 -I . -v t

clean :
@rm -f docs/Tags.md docs/Tags/*.md docs/Tags/*/*.md
Expand Down
7 changes: 3 additions & 4 deletions lib/PDF/Tags/Node/Parent.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Returns an XPath expression to locate the node in the document tree.
Returns a Hash of child nodes (arrays of lists) and attributes (prefixed by '@')
say $tags.first('Document/L[1]').Hash<LBody>[0].text; # text of first list-item
say $tags.first('Document/L[1]').Hash<@ListNumbering>; # lit numbering attribute
say $tags.first('Document/L[1]').Hash<@ListNumbering>; # list numbering attribute
=head3 Alias methods
Expand All @@ -289,17 +289,16 @@ List(L), ListItem(LI), Label(Lbl), ListBody(LBody),
=head4 Table Tags
Table, TableRow(TR), TableHeader(TH),
Table, TableRow(TR), TableHeader(TH),
TableData(TD), TableBody(TBody), TableFooter(TFoot),
=head4 Inline Element Tags
Span, Quotation(Quote), Note, Reference,
BibliographyEntry(BibEntry), Code, Link,
Annotation(Annot),
Annotation(Annot), Artifact,
Ruby, RubyPunctutation(RP), RubyBaseText(RB), RubyText(RT),
Warichu, WarichuPunctutation(RP), WarichuText(RT),
Artifact,
=head4 Illustration Tags
Expand Down
4 changes: 2 additions & 2 deletions lib/PDF/Tags/XML-Writer.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ multi method stream-xml(PDF::Tags::Elem $node, UInt :$depth is copy = 0) {
%attributes<href> = $_ with find-href($node);
}
atts-str(%attributes);
}
} // '';
$name = $_ with $role;
my $omit-tag = $name ~~ $_ with $!omit;
Expand Down Expand Up @@ -314,7 +314,7 @@ method !marked-content(PDF::Tags::Mark $node, :$depth!) {
my $omit-tag = ! $!marks;
$omit-tag ||= $name ~~ $_ with $!omit;
if $omit-tag {
if $!atts && $omit-tag !~~ 'Span' {
if $!atts && !($!omit ~~ 'Span') {
# try to retain content-level language tags
my $Lang := .<Lang>
with $node.attributes;
Expand Down

0 comments on commit a6947c2

Please sign in to comment.