Skip to content

Block#getContent() can return Opal.nil #1692

@mojavelinux

Description

@mojavelinux

For certain blocks, calling getContent() can return Opal.nil. Until Asciidoctor > 2.0.18 is released, this can happen if a raw (e.g., passthrough) or verbatim (e.g., listing) block has no lines.

console.dir(Asciidoctor.load('----\n----').getBlocks()[0].getContent())

The Opal.nil return value can also happen if this method is called on a block macro. Regardless of this variation in core, I think Asciidoctor.js should protect against client code setting an Opal.nil return value.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions