asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 296 forks source link

ifdef only works in preview with attributes defined in the document header #560

Closed a-worsley closed 1 year ago

a-worsley commented 1 year ago

The following works as expected when compiled with AsciiDoctor. But the AsciiDocFX previewer only displays the test inside the var-1 conditional block (var-2 conditional block does not get displayed).

= AsciiDocFX Bug
// var-1 is in the document header
:var-1:

// var-2 is not in the document header
:var-2:

ifdef::var-1[]
var-1 is included
endif::[]

ifdef::var-2[]
var-2 is included...or at least it should be
endif::[]
rahmanusta commented 1 year ago

Hi, thanks for reporting. Version 1.7.8 should fix the issue: https://github.com/asciidocfx/AsciidocFX/releases/tag/v1.7.8

a-worsley commented 1 year ago

Seems to work now, thanks!