owenh000 / asciidoctor-multipage

A configurable multipage HTML converter for Asciidoctor
https://owenh.net/asciidoctor-multipage
MIT License
58 stars 23 forks source link

Preamble affects included attributes #23

Open oddhack opened 2 years ago

oddhack commented 2 years ago

I see inconsistent behavior when using the extension with or without a pagebreak ('<<<<') included in the preamble. It appears that attributes set in a file that is included prior to the pagebreak are not being set, or perhaps are being scoped out of existence by the time those attributes are used in the following document markup. I haven't tried to further characterize if anything else might not work, but do have a trivial test case which I'll attach. The prebuilt outputs are included and just 'make compare' will show the differences. 'make clean compare' will regenerate the outputs. Building without the extensions and with the normal 'html5' target generates identical outputs with the attributes properly set (I haven't included a rule for this, as the differences in behavior of the extension WRT the page break are the issue).

test.tar.gz

This is using asciidoctor-multipage 0.0.12, asciidoctor 2.0.12, and Ruby 2.5 on Debian stretch.

owenh000 commented 2 years ago

@oddhack, thanks for the report and the clear test case. This also occurs when using asciidoctor-multipage with Asciidoctor 2.0.16. And I'm seeing the behavior when there is any preamble (no page break). Here is another test case here to further demonstrate the problem.

attributes.adoc:

:myattr: myvalue

test.adoc:

= test issue #23

include::attributes.adoc[]

If this preamble is removed, the attribute below (in Chapter) will work.

== Chapter

This should be *myvalue*: {myattr}

To test locally (in the repository):

$ bundler exec asciidoctor -r asciidoctor-multipage -b multipage_html5 test.adoc
owenh000 commented 3 months ago

This issue may require #46 to be done first.