Skip to content

Commit

Permalink
Manually remove stylesheet attr for child docs
Browse files Browse the repository at this point in the history
Cloning Document.attributes does not preserve a deleted attribute key,
so if the stylesheet attribute does not exist in the original
Document, remove it in all the generated Documents.

Closes #44.
  • Loading branch information
owenh000 committed Dec 18, 2023
1 parent 4110e7e commit 3fc124b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/asciidoctor-multipage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,11 @@ def convert_section(node)
:doctype => doc.doctype,
:header_footer => !doc.attr?(:embedded),
:safe => doc.safe})
# Manually remove stylesheet attribute if not set on original document
# (why is doc.attributes.clone not adequate?)
if ! doc.attributes.has_key?('stylesheet')
page.remove_attr('stylesheet')
end
# Retain webfonts attribute (why is doc.attributes.clone not adequate?)
page.set_attr('webfonts', doc.attr(:webfonts))
# Save sectnum for use later (a Document object normally has no sectnum)
Expand Down

0 comments on commit 3fc124b

Please sign in to comment.