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