Class Asciidoctor::Block
In: lib/asciidoctor/block.rb
Parent: AbstractBlock

Public: Methods for managing blocks of Asciidoc content in a section.

Examples

  block = Asciidoctor::Block.new(document, :paragraph, ["`This` is a <test>"])
  block.content
  => ["<em>This</em> is a &lt;test&gt;"]

Methods

content   new   render   to_s  

External Aliases

context -> blockname
  Public: Create alias for context to be consistent w/ AsciiDoc

Attributes

buffer  [RW]  Public: Get/Set the original Array content for this section block.

Public Class methods

Public: Initialize an Asciidoctor::Block object.

parent - The parent Asciidoc Object. context - The Symbol context name for the type of content. buffer - The Array buffer of source data (default: nil).

Public Instance methods

Public: Get an HTML-ified version of the source buffer, with special Asciidoc characters and entities converted to their HTML equivalents.

Examples

  doc = Asciidoctor::Document.new
  block = Asciidoctor::Block.new(doc, :paragraph,
            ['`This` is what happens when you <meet> a stranger in the <alps>!'])
  block.content
  => ["<em>This</em> is what happens when you &lt;meet&gt; a stranger in the &lt;alps&gt;!"]

Public: Get the rendered String content for this Block. If the block has child blocks, the content method should cause them to be rendered and returned as content that can be included in the parent block‘s template.

[Validate]