Sha256: c82f93eab77a7800f18a35e50eea0c0bdd3132c495b2c7c5955f922feec03808
Contents?: true
Size: 421 Bytes
Versions: 16
Compression:
Stored size: 421 Bytes
Contents
module Ecrire::Markdown::Parsers class Word < Base RULE = /((\*{1,2})([^\*]+)(\*{1,2}))/i def parse! while match = RULE.match(@node.content) do if match[2].length == 1 @node.content.gsub! match[0], "<em>#{match[3]}</em>" elsif match[2].length == 2 @node.content.gsub! match[0], "<strong>#{match[3]}</strong>" end end return @node end end end
Version data entries
16 entries across 16 versions & 1 rubygems