lib/brief/document/rendering.rb in brief-1.9.11 vs lib/brief/document/rendering.rb in brief-1.9.12
- old
+ new
@@ -1,17 +1,11 @@
module GitHub
class Markdown
-
def self.render_gfm(content)
- html = self.to_html(content, :gfm)
- html = add_level_and_heading(html)
- html
+ self.to_html(content, :gfm).tap do |html|
+ html.gsub!(/<h([1-6])>(.+?)<\/h\1>/,"<h\\1 data-level='\\1' data-heading='\\2'>\\2<\/h\\1>")
+ end
end
-
- def self.add_level_and_heading(html)
- html.gsub(/<h([1-6])>(.+?)<\/h\1>/,"<h\\1 data-level='\\1' data-heading='\\2'>\\2<\/h\\1>")
- end
-
end
end
module Brief
class Document