asciidoctor / asciidoctor-mathematical

An extension for Asciidoctor that converts the content of STEM blocks and inline macros using Mathematical.
MIT License
49 stars 44 forks source link

undefined method `lines=' for #<Asciidoctor::Table::Cell:0x000055a734095200> #52

Closed lmoellendorf closed 5 years ago

lmoellendorf commented 5 years ago

Trying to use inline stem macros inside AsciiDoc table cells with asciidoctor-mathematical-0.3.0.

This is the test.adoc:

|===
| latexmath:[test]
|===

This is the trace output:

asciidoctor-pdf  -r asciidoctor-mathematical test.adoc --trace
/usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:105:in `handle_prose_block': asciidoctor: FAILED: /doc/test.adoc: Failed to load AsciiDoc document - undefined method `lines=' for #<Asciidoctor::Table::Cell:0x00005571234e7638> (NoMethodError)
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:41:in `block in process'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:40:in `each'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-mathematical-0.3.0/lib/asciidoctor-mathematical/extension.rb:40:in `process'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/document.rb:557:in `[]'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/document.rb:557:in `block in parse'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/document.rb:556:in `each'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/document.rb:556:in `parse'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor.rb:1304:in `load'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor.rb:1413:in `convert'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor.rb:1521:in `block in convert_file'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor.rb:1521:in `open'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor.rb:1521:in `convert_file'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/cli/invoker.rb:111:in `each'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.6/lib/asciidoctor/cli/invoker.rb:111:in `invoke!'
        from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/bin/asciidoctor-pdf:31:in `<top (required)>'
        from /usr/bin/asciidoctor-pdf:23:in `load'
        from /usr/bin/asciidoctor-pdf:23:in `<main>'

These are the versions:

asciidoctor-pdf  --version
Asciidoctor PDF 1.5.0.alpha.16 using Asciidoctor 2.0.6 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
asciidoctor  --version
Asciidoctor 2.0.6 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
lmoellendorf commented 5 years ago

Just found out that it works applying asciidoc table style:

|===
a| latexmath:[test]
|===

I was not aware that this is necessary. So I close this issue.

darevan commented 5 years ago

I am getting this same error when trying to convert the sample.adoc. Therefore either there is an issue with the code in not being able to covert inline stems within tables without the AsciiDoc style (a) or the sample.adoc should be updated.

Either way I think this issue should be re-opened.