class Asciidoctor::Extensions::InlineMacroProcessor

Public: InlineMacroProcessors are used to handle block macros that have a custom name.

InlineMacroProcessor implementations must extend InlineMacroProcessor.

Constants

DSL

Public Class Methods

new(name, config = {}) click to toggle source
# File lib/asciidoctor/extensions.rb, line 425
def initialize name, config = {}
  super
  @config[:regexp] ||= (resolve_regexp @name, @config[:format])
end

Public Instance Methods

resolve_regexp(name, format) click to toggle source
# File lib/asciidoctor/extensions.rb, line 430
def resolve_regexp name, format
  # TODO memoize these regular expressions!
  if format == :short
    %r(\?#{name}:\[((?:\\]|[^\]])*?)\])
  else
    %r(\?#{name}:(\S+?)\[((?:\\]|[^\]])*?)\])
  end
end