Class Texy::Modules::HorizLine
In: lib/texy/modules/horiz_line.rb
Parent: Base

Horizontal line module class

Methods

Attributes

handler  [RW]  Proc that will be called with newly created element

Public Instance methods

Module initialization.

[Source]

# File lib/texy/modules/horiz_line.rb, line 40
            def init
                texy.register_block_pattern(
                    method(:process_block),
                    /^(- |-|\* |\*){3,} *#{PATTERN_MODIFIER_H}?()$/
                )
            end

Callback function (for blocks)

   ---------------------------

   - - - - - - - - - - - - - -

   ***************************

   * * * * * * * * * * * * * *

[Source]

# File lib/texy/modules/horiz_line.rb, line 58
            def process_block(parser, matches)
                el = BlockElement.new(texy)
                el.tag = 'hr'
                el.modifier.set_properties(*matches[2..-1])

                if handler
                    return unless handler.call(el)
                end

                parser.element.append_child(el)
            end

[Validate]