Sha256: 532e010b48e500e59178b2cf1865f5520ad3a4929b50ae72f884b0361ce20ed2

Contents?: true

Size: 263 Bytes

Versions: 4

Compression:

Stored size: 263 Bytes

Contents

require 'wparser/parse'

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