AsciidocFX icon indicating copy to clipboard operation
AsciidocFX copied to clipboard

counter: wrong evaluation

Open newbie-02 opened this issue 1 year ago • 3 comments

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.

newbie-02 avatar May 05 '24 09:05 newbie-02

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

rahmanusta avatar May 05 '24 20:05 rahmanusta

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 avatar May 06 '24 20:05 newbie-02

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]

newbie-02 avatar Jul 01 '24 16:07 newbie-02