Sha256: 9caf30ea28fb226db692a3f7009c0bb9a053f6e7ba5576c217fda936d169f404

Contents?: true

Size: 271 Bytes

Versions: 4

Compression:

Stored size: 271 Bytes

Contents

require 'wparser/parse'

module Inlines
  class UnderLine < Parse
    def self.parse line
      @result = line.gsub!(/(?:(?!\\\+)(^|.)\+)(.+?)(?:(?!\\\+)(.)\+)/){|s|
        "#$1<U>#$2#$3</U>"
      }
      @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/underLine.rb
wparser-0.1.2 lib/wparser/inline/underLine.rb
wparser-0.1.1 lib/wparser/inline/underLine.rb
wparser-0.1.0 lib/wparser/inline/underLine.rb