Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToC generated inside block level (a) table cells with toc2 attr set on command line #32

Open
pdabr1 opened this issue Mar 4, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@pdabr1
Copy link

pdabr1 commented Mar 4, 2022

If a document contains a table with a multi line cell (with prefix a), the table of contents is generated into this cell.
Example document with html output attached.

tested with version 0.0.15

command used to create html output:
docker run --rm --user $(id -u) -v $(pwd):/documents/ gbif/asciidoctor-toolkit asciidoctor -r asciidoctor-multipage -b multipage_html5 -D . -a toc2 -a toclevels=3 -a toc=left -a docinfo=shared testtable.adoc -o testtable.html

testtable.zip

@owenh000
Copy link
Owner

owenh000 commented Mar 4, 2022

@pdabr1, it works for me. There is already a test for this too at test/black-box-docs/table-block-operator/.

Are you sure you are using asciidoctor-multipage v0.0.15?

@owenh000 owenh000 added the question Further information is requested label Mar 4, 2022
@pdabr1
Copy link
Author

pdabr1 commented Mar 7, 2022

@owenh000, thanks for the reply. I could get it to work. I converted the files into unix format and changed "-a toc2" of the build command into "-a toc".

@pdabr1 pdabr1 closed this as completed Mar 7, 2022
@owenh000
Copy link
Owner

owenh000 commented Mar 7, 2022

@pdabr1, I'm glad you got it working. Thanks for the update.

It looks like the -a toc2 option on the command line is what breaks it; I missed that earlier. You should be able to work around this by setting the :toc2: document attribute inside the source file rather than with the -a option.

It appears that the document attribute specified on the command line is getting passed to the nested document when it shouldn't. I'll update the issue title and reopen this.


Test file test.adoc:

= Title
:toc2:

== Header1

|===
|Column1        |Column2
|Regular cell  a|ToC should not appear in this cell
|===

Test commands:

## This breaks
$ asciidoctor -r asciidoctor-multipage -b multipage_html5 -a toc2 -D test/out test.adoc

## This works
$ asciidoctor -r asciidoctor-multipage -b multipage_html5 -D test/out test.adoc

@owenh000 owenh000 changed the title "Table of Contents" is generated into multi line table cells ToC generated inside block level (a) table cells with toc2 attr set on command line Mar 7, 2022
@owenh000 owenh000 added bug Something isn't working and removed question Further information is requested labels Mar 7, 2022
@owenh000 owenh000 reopened this Mar 7, 2022
@pdabr1
Copy link
Author

pdabr1 commented Mar 7, 2022

@owenh000 thanks for looking into this in depth. I'm glad I didn't waste your time. Keep on the good work 👍

@owenh000
Copy link
Owner

owenh000 commented Apr 3, 2024

Completing issue #46 would probably fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants