Sha256: 0df3c93407e409b2eac90015037fdfff781233fa497e08be1b0c19132575d1fe

Contents?: true

Size: 278 Bytes

Versions: 4

Compression:

Stored size: 278 Bytes

Contents

require 'wparser/parse'

module Inlines
  class Strong < Parse
    def self.parse line
      @result = line.gsub!(/(?:(?!\\\*)(^|.)\*)(.+?)(?:(?!\\\*)(.)\*)/){|s|
        "#$1<strong>#$2#$3</strong>"
      }
      @result = line.gsub!(/\\\*/, '*')
      super
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wparser-0.1.3 lib/wparser/inline/strong.rb
wparser-0.1.2 lib/wparser/inline/strong.rb
wparser-0.1.1 lib/wparser/inline/strong.rb
wparser-0.1.0 lib/wparser/inline/strong.rb