Module: MaRuKu::In::Markdown

### Home Classes Methods

### In Files

- lib/maruku/input/charsource.rb
- lib/maruku/input/extensions.rb
- lib/maruku/input/html_helper.rb
- lib/maruku/input/linesource.rb
- lib/maruku/input/parse_block.rb
- lib/maruku/input/parse_doc.rb
- lib/maruku/input/parse_span_better.rb
- lib/maruku/input/rubypants.rb
- lib/maruku.rb

### Namespace

- MODULE MaRuKu::In::Markdown::BlockLevelParser
- MODULE MaRuKu::In::Markdown::SpanLevelParser
- CLASS MaRuKu::In::Markdown::SpanExtension

### Methods

- ::register_block_extension
- ::register_span_extension
- #any_matching_block_extension?
- #check_block_extensions
- #check_span_extensions

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::In::Markdown

### Constants

BlockExtensions

  Hash Regexp -> Block

SpanExtensions

  Hash String -> Extension

SpanExtensionsTrigger

  Hash Fixnum -> name

### Public Class Methods

register_block_extension(args) click to toggle source

    # File lib/maruku/input/extensions.rb, line 42
    def self.register_block_extension(args)
            regexp = args[:regexp]
            BlockExtensions[regexp] = (args[:handler] || raise("No blocks passed"))
    end

register_span_extension(args) click to toggle source

    # File lib/maruku/input/extensions.rb, line 32
    def self.register_span_extension(args)
            e = SpanExtension.new
            e.chars = [*args[:chars]]
            e.regexp = args[:regexp]
            e.block = args[:handler] || raise("No blocks passed")
            e.chars.each do |c|
                    (SpanExtensionsTrigger[c] ||= []).push e
            end
    end

### Public Instance Methods

any_matching_block_extension?(line) click to toggle source

    # File lib/maruku/input/extensions.rb, line 61
    def any_matching_block_extension?(line)
            BlockExtensions.each_key do |reg|
                    m = reg.match(line)
                    return m if m
            end
            return false
    end

check_block_extensions(src, con, line) click to toggle source

    # File lib/maruku/input/extensions.rb, line 50
    def check_block_extensions(src, con, line)
            BlockExtensions.each do |reg, block|
                    if m = reg.match(line)
                            block = BlockExtensions[reg]
                            accepted =  block.call(doc, src, con)
                            return true if accepted
                    end
            end
            return false # not special
    end

check_span_extensions(src, con) click to toggle source

    # File lib/maruku/input/extensions.rb, line 20
    def check_span_extensions(src, con)
            c = src.cur_char
            if extensions = SpanExtensionsTrigger[c]
                    extensions.each do |e|
                            if e.regexp && (match = src.next_matches(e.regexp))
                                    return true if e.block.call(doc, src, con)
                            end
                    end
            end
            return false # not special
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.