Sha256: 56844c18259ce5f3a64bb72703c6224f9c2a1792d7f2031f61ee1afba932f2fd

Contents?: true

Size: 278 Bytes

Versions: 2

Compression:

Stored size: 278 Bytes

Contents

require 'wparser/parse'

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wparser-0.1.3 lib/wparser/inline/code.rb
wparser-0.1.2 lib/wparser/inline/code.rb