lib/maruku/output/to_html.rb
def correct_document(doc)
    if RUBY_PLATFORM == 'java'
      doc = doc.
        gsub(/<br>/, '<br />'). # JRuby nokogiri bug https://github.com/sparklemotion/nokogiri/issues/834
        gsub(/<hr>/, '<hr />')

      # Fix more JRuby Nokogiri closing slash awfulness
      doc = doc.gsub(/<img(.*?)>/) do |match|
        if ($1.end_with?('/'))
          "<img#{$1}>"
        else
          "<img#{$1} />"
        end
      end
      doc = doc.gsub(/<([\w:]+)([^>]*?)\s*\/><\/\1>/, '<\1\2></\1>')
    end

    doc.strip
  end
# Correct for bugs in JRuby nokogiri
Correct for bugs in JRuby nokogiri
Correct for bugs in JRuby nokogiri
def correct_document(doc)
    if RUBY_PLATFORM == 'java'
      doc = doc.
        gsub(/<br>/, '<br />'). 
        gsub(/<hr>/, '<hr />')
      doc = doc.gsub(/<img(.*?)>/) do |match|
        if ($1.end_with?('/'))
          "<img#{$1}>"
        else
          "<img#{$1} />"
        end
      end
      doc = doc.gsub(/<([\w:]+)([^>]*?)\s*\/><\/\1>/, '<\1\2></\1>')
    end
    doc.strip
  end
def correct_document ( doc ) if RUBY_PLATFORM == 'java' doc = doc . gsub ( / <br> / , '<br />' ) . gsub ( / <hr> / , '<hr />' ) doc = doc . gsub ( / <img(.*?)> / ) do | match | if ( $1 . end_with? ( '/' ) ) "<img#{$1}>" else "<img#{$1} />" end end doc = doc . gsub ( / <([ \w :]+)([^>]*?) \s * \/ >< \/ \1 > / , '<\1\2></\1>' ) end doc . strip end
Correct for bugs in JRuby nokogiri
Correct for bugs in JRuby nokogiri
# JRuby nokogiri bug https://github.com/sparklemotion/nokogiri/issues/834 # Fix more JRuby Nokogiri closing slash awfulness
doc