class Asciidoctor::Extensions::Preprocessor

Public: Preprocessors are run after the source text is split into lines and normalized, but before parsing begins.

Prior to invoking the preprocessor, Asciidoctor splits the source text into lines and normalizes them. The normalize process strips trailing whitespace and the end of line character sequence from each line.

Asciidoctor passes the document and the document’s Reader to the {Processor#process} method of the Preprocessor instance. The Preprocessor can modify the Reader as necessary and either return the same Reader (or falsy, which is equivalent) or a reference to a substitute Reader.

Preprocessor implementations must extend the Preprocessor class.

Constants

DSL

Public Instance Methods

process(document, reader) click to toggle source
# File lib/asciidoctor/extensions.rb, line 388
def process document, reader
  raise ::NotImplementedError, %(#{Preprocessor} subclass #{self.class} must implement the ##{__method__} method)
end