asciidoctor.js
asciidoctor.js copied to clipboard
AbstractBlock#append() does not dispatch to overwritten append methods (for section/document)
In https://github.com/asciidoctor/asciidoctor/blob/d352fa7ef051c7fbcf05ae70ac69eedfd4bdc694/lib/asciidoctor/document.rb#L809 the append method is overwritten to update the section numbers when adding a section to a document (similar code exists for sections). Calling append() on a document in JavaScript seems to dispatch to the AbstractBlock version which does not handle updates to section numbers. As a result section numbering and TOC generation does not work as expected when programmtically adding sections to documents. A workaround is to call document["$<<"](section) directly instead
Indeed, we do not define the append method on the Document object. Would you like to submit a pull request (with a test) to fix this issue?