class Asciidoctor::Extensions::InlineMacroProcessor - asciidoctor-1.5.6.2 Documentation

# 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 Instance Methods

regexp() click to toggle source

Lookup the regexp option, resolving it first if necessary. Once this method is called, the regexp is considered frozen.

    # File lib/asciidoctor/extensions.rb, line 558
    def regexp
      @config[:regexp] ||= resolve_regexp @name.to_s, @config[:format]
    end

resolve_regexp(name, format) click to toggle source

    # File lib/asciidoctor/extensions.rb, line 562
    def resolve_regexp name, format
      raise ::ArgumentError, %Q(invalid name for inline macro: #{name}) unless MacroNameRx.match? name
      @@rx_cache[[name, format]] ||= /\?#{name}:#{format == :short ? '(){0}' : '(\S+?)'}\[(|.*?[^\])\]/
    end