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

Lists in tables cause NPE #13

Closed
veselov opened this issue Jun 27, 2021 · 1 comment · Fixed by #14
Closed

Lists in tables cause NPE #13

veselov opened this issue Jun 27, 2021 · 1 comment · Fixed by #14

Comments

@veselov
Copy link
Contributor

veselov commented Jun 27, 2021

With these files:
index.adoc

= Pirate Product Documentation

:toc:

:leveloffset: +1

include::index2.adoc[]

:leveloffset: -1

index2.adoc

= Pirate Backend
:leveloffset: +1

include::Configuration.adoc[]

:leveloffset: -1

Configuration.adoc

= Pirate Configuration Reference

== Value Specification

[cols=","]
|===
|abc.$\{ext} a|
* item

|===

Multipage, when invoked as:

$ asciidoctor -a multipage-level=2 --trace -v  -r asciidoctor-multipage -r asciidoctor-diagram -b multipage_html5 -D. -o index.html index.adoc

throws an NPE:

Traceback (most recent call last):
23: from /usr/bin/asciidoctor:23:in <main>' 22: from /usr/bin/asciidoctor:23:in load'
21: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/bin/asciidoctor:15:in <top (required)>' 20: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/cli/invoker.rb:113:in invoke!'
19: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/cli/invoker.rb:113:in each' 18: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/cli/invoker.rb:130:in block in invoke!'
17: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/convert.rb:189:in convert_file' 16: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/convert.rb:189:in open'
15: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/convert.rb:189:in block in convert_file' 14: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/convert.rb:123:in convert'
13: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/document.rb:971:in write' 12: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:541:in write'
11: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:541:in each' 10: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:544:in block in write'
9: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:544:in open' 8: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:545:in block (2 levels) in write'
7: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/document.rb:944:in convert' 6: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/converter/html5.rb:84:in convert'
5: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:126:in convert_document' 4: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/converter/html5.rb:218:in convert_document'
3: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/converter/html5.rb:88:in convert' 2: from /home/vps/.gem/ruby/gems/asciidoctor-2.0.15/lib/asciidoctor/converter.rb:389:in convert'
1: from /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:408:in convert_outline' /home/vps/.gem/ruby/gems/asciidoctor-multipage-0.0.9/lib/asciidoctor-multipage.rb:252:in generate_outline': undefined method `level' for nil:NilClass (NoMethodError)

$ asciidoctor -v
Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
@veselov veselov changed the title Certain table configuration causes NPE Lists in tables cause NPE Jun 27, 2021
@veselov veselov mentioned this issue Jun 27, 2021
owenh000 added a commit that referenced this issue Jun 28, 2021
Add support for AsciiDoc "a" operator block-level table styling, which
supports block elements in a table cell by internally nesting a
separate document.

Thanks to @veselov for contributing this fix.

Closes both
<#13> and
<#1>.

See <#14>.
@veselov
Copy link
Contributor Author

veselov commented Jun 28, 2021

Unfortunately, the fix is not complete. At least I think so. Anyway, I'll open another issue for this once I have a clear cut test case.

In short, what I observe so far is that the ToC that is expected to be displayed at the top of the document gets cut off once viewing the section that had the offending nesting, or any sections that follow it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant