Sha256: 888c0fd04ad1cffe4f79dbbd0fa982386d207964b26572e09d53f3d1b45b659e
Contents?: true
Size: 425 Bytes
Versions: 16
Compression:
Stored size: 425 Bytes
Contents
module Ecrire::Markdown::Parsers class Heading < Base RULE = /^(\#{1,6} )(.+)/i def parse! unless @node.instance_of?(Ecrire::Markdown::Node) return @node end if match = RULE.match(@node.content) size = match[1].length - 1 @node = Ecrire::Markdown::Nodes::Heading.new(size, match[2]) @document.nodes[@index] = @node end return @node end end end
Version data entries
16 entries across 16 versions & 1 rubygems