59
59
text.gsub!(/\A\s*(.*)\Z/m, '<p>\1</p>')
60
60
text.gsub!(/\s*\n(\s*\n)+\s*/, "</p>\n<p>")
62
text.gsub!(/(#{URI::regexp(['http','ftp','https'])})/,
62
text.gsub!(/([^'"])(#{URI::regexp(['http','ftp','https'])})/,
65
65
# Handle broken hrefs in <a> and <img>