Closed ioquatix closed 4 years ago
See https://github.com/gettalong/kramdown/blob/4458c23153884cb576e4a57739e191317256abea/lib/kramdown/element.rb#L24-L45 for information on the root element. It not only has the :encoding
option but also others.
So if you only want to convert a small part, duplicate the root node and assign the node you want to convert as children, ie. new_root = root.dup; new_root.children = [node]
.
Should we add documentation on how to do this?
That is a good idea - will see about it.
Done
https://github.com/gettalong/kramdown/blob/4458c23153884cb576e4a57739e191317256abea/lib/kramdown/converter/base.rb#L110
In order to convert a small part of the document, I had to copy the encoding:
Maybe you could allow: