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

NoMethodError in traverse #98

Closed
lzap opened this issue Nov 13, 2021 · 3 comments
Closed

NoMethodError in traverse #98

lzap opened this issue Nov 13, 2021 · 3 comments
Assignees
Milestone

Comments

@lzap
Copy link

lzap commented Nov 13, 2021

Hey, I am trying to document a single document, it is quite large tho.

I would like to dig into this but the error does not make much sense. I would like to see what element in the tree caused this. Any hint?

(NoMethodError)
Did you mean?  convert_a
               convert_br
               convert_hr
               convert_p
               convert_root
               convert_math
               convert_dd
               convert_dt
               convert_li
               convert_dl
               convert_ol
               convert_ul
               convert_em
               convert_img
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:668:in `block in traverse'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `each'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `each_with_index'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `traverse'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:680:in `compose_text'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:562:in `convert_html_element'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:102:in `convert'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:668:in `block in traverse'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `each'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `each_with_index'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:667:in `traverse'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:108:in `convert_root'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/converter.rb:102:in `convert'
	from /home/lzap/.gem/ruby/gems/kramdown-2.3.1/lib/kramdown/converter/base.rb:107:in `convert'
	from /home/lzap/.gem/ruby/gems/kramdown-2.3.1/lib/kramdown/document.rb:116:in `method_missing'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/api.rb:55:in `convert'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/api.rb:107:in `convert_file'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/lib/kramdown-asciidoc/cli.rb:120:in `run'
	from /home/lzap/.gem/ruby/gems/kramdown-asciidoc-2.0.0/bin/kramdoc:13:in `<top (required)>'
	from /home/lzap/.gem/ruby/bin/kramdoc:23:in `load'
	from /home/lzap/.gem/ruby/bin/kramdoc:23:in `<main>'
@lzap
Copy link
Author

lzap commented Nov 13, 2021

manual.md

Attaching the input markdown file, it is essentially slightly modified: https://theforeman.org/manuals/3.0/index.html

@lzap
Copy link
Author

lzap commented Nov 13, 2021

For the record, this appears to be a vaid kramdown document, it does generate HTML with few warnings:

$ kramdown manual.md > manual.html
Warning: Found invalidly used HTML closing tag for 'span' on line 638
Warning: No link definition for link ID '[faq]' found on line 3791
Warning: No link definition for link ID 'faq' found on line 3791
Warning: No link definition for link ID '"fqdn", "hostgroup", "os", "domain"' found on line 3986
Warning: No link definition for link ID 'foreman' found on line 4007
Warning: No link definition for link ID 'puppetserver1.yourdomain.com, puppetserver2.yourdomain.com' found on line 4307
Warning: No link definition for link ID '' found on line 4308
Warning: No link definition for link ID 'master' found on line 4493
Warning: Found no end tag for 'realm-name' (line 10769) - auto-closing it
Warning: Found no end tag for 'keycloak.example.com' (line 10769) - auto-closing it
Warning: Found no end tag for 'realm-name' (line 10783) - auto-closing it
Warning: Found no end tag for 'keycloak.example.com' (line 10783) - auto-closing it
Warning: No link definition for link ID 'object event' found on line 10928
Warning: No link definition for link ID ':name' found on line 11115

@mojavelinux
Copy link
Member

The issue that is causing the converter to crash is that it is not handling the raw <script> tag. There are other elements it doesn't convert correctly in this content, but only this tag causes the converter to crash. I'll apply a patch.

@mojavelinux mojavelinux self-assigned this Jun 29, 2022
@mojavelinux mojavelinux added this to the v2.0.x milestone Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants