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 297 forks source link

counter: wrong evaluation #637

Open newbie-02 opened 2 months ago

newbie-02 commented 2 months ago

looks as there are issues blocking the use of counters as proposed in e.g.
https://stackoverflow.com/questions/57301720/asciidoc-table-for-counter-values-and-text-references and
https://github.com/asciidoctor/asciidoctor-extensions-lab/issues/111

Whatever I try I end up in doubled values, e.g.

= My AsciiDoc
:counter: recom: 0

* Testtext 

* R{counter:recom}: sentence1 
...
* R{counter:recom}: sentence2
...
* R{counter:recom}: sentence3

renders to:

My AsciiDoc
Testtext

R4: sentence1 …​

R5: sentence2 …​

R6: sentence3 

note the counting R4-R5-R6 instead of R1-R2-R3.
Assume it's a side effect from some 'two passes over the document' evaluation,
but that's guessing only.

TIA for any help, apologize if 'me bad', that's always an option.

rahmanusta commented 2 months ago

Hi, thank you, I found out the issue, and it should be fixed on the next release.

newbie-02 commented 1 month ago

hi, I have to thank you!

may I, I know it's cruel but really have an issue and see you as the only active programmer ...

again ping on #459? If it's not solveable pls. leave a comment about it, for me and others to know we have to look for alternatives.

:-)

newbie-02 commented 3 days ago

seems partly! fixed in 1.8.10,

the simple sample with 1 counter holds, but try the following:

 = My AsciiDoc
:counter: recom: 0
:counter: table-number: 0

* Testtext 

* R{counter:recom}: sentence1 
...
* R{counter:recom}: sentence2
...
* R{counter:recom}: sentence3

[title="grobe Schnitzer in MS Excel Rundungsfunktionen", id="Table-{counter:table-number}", width="60%", options="header"]
[%autowidth]
|====================
| x | sin( x * π ) 
|====================

[title="grobe Schnitzer in MS Excel Rundungsfunktionen", id="Table-{counter:table-number}", width="60%", options="header"]
[%autowidth]
|====================
| x | sin( x * π ) 
|====================

[title="grobe Schnitzer in MS Excel Rundungsfunktionen", id="Table-{counter:table-number}", width="60%", options="header"]
[%autowidth]
|====================
| x | sin( x * π ) 
|====================

[title="grobe Schnitzer in MS Excel Rundungsfunktionen", id="Table-{counter:table-number}", width="60%", options="header"]
[%autowidth]