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

Error "undefined method `attr?' for nil" if :doctype: book, :!sectids:, and plantuml with format=svg #452

Open
donparakin opened this issue Jun 16, 2024 · 0 comments
Labels

Comments

@donparakin
Copy link

donparakin commented Jun 16, 2024

I'm getting a strange error that I've narrowed down to this document. I'm running Docker image asciidoctor/docker-asciidoctor:1.72.0 (haven't tried it with other images):

= Minimal Doc
:doctype: book
:!sectids:

== The Diagrams

[plantuml,,format=svg]
----
@startebnf
Command = "piku", "apps";
@endebnf
----

fails with error: undefined method `attr?' for nil

Strangely, the problem goes away if one of the following is done: 1) remove format=svg from the plantuml diagram, 2) remove the == The Diagrams section, 3) remove :!sectids:, or 4) remove :doctype: book. Is this a bug or PEBCAK?

The trace of the error is:

/usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:1029:in `register_media_file': undefined method `attr?' for nil (NoMethodError)

          chapter.set_attr 'epub-properties', [] unless chapter.attr? 'epub-properties'
                                                               ^^^^^^
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:1148:in `convert_image'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:115:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:76:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `block in content'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `map'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `content'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:485:in `convert_section'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:115:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:76:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `block in content'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `map'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/abstract_block.rb:85:in `content'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:1012:in `content'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:258:in `convert_document'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/lib/asciidoctor-epub3/converter.rb:115:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/document.rb:956:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:118:in `convert'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in `block in convert_file'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in `open'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/convert.rb:190:in `convert_file'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:129:in `block in invoke!'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:112:in `each'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-2.0.23/lib/asciidoctor/cli/invoker.rb:112:in `invoke!'
        from /usr/lib/ruby/gems/3.3.0/gems/asciidoctor-epub3-2.1.3/bin/asciidoctor-epub3:28:in `<top (required)>'
        from /usr/bin/asciidoctor-epub3:25:in `load'
        from /usr/bin/asciidoctor-epub3:25:in `<main>'
@dduportal dduportal added the bug label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants