You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root = Kramdown::Element.new(:root)
root.children << Kramdown::Element.new(:text, 'stuff')
Kramdown::Converter::Kramdown.convert(root)
2: from /Users/joey/.rvm/gems/ruby-2.6.3/gems/kramdown-2.1.0/lib/kramdown/converter/base.rb:109:in `convert'
1: from /Users/joey/.rvm/gems/ruby-2.6.3/gems/kramdown-2.1.0/lib/kramdown/converter/base.rb:109:in `encode!'
TypeError (no implicit conversion of nil into String)
Now, it makes sense that an encoding is needed. But the error it produces doesn't really point to the source of the problem at all - I had to look at kramdown's source to figure out what was actually wrong.
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. It is rather rare that someone is building an AST from scratch, so there is not much support in terms of better error messages et al. I will update the respective code to make at least this error message better.
Simplified example:
what works:
Now, it makes sense that an encoding is needed. But the error it produces doesn't really point to the source of the problem at all - I had to look at
kramdown
's source to figure out what was actually wrong.The text was updated successfully, but these errors were encountered: