Class: GitHub::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/brief/document/rendering.rb

Class Method Summary collapse

Class Method Details

.add_level_and_heading(html) ⇒ Object



10
11
12
# File 'lib/brief/document/rendering.rb', line 10

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

.render_gfm(content) ⇒ Object



4
5
6
7
8
# File 'lib/brief/document/rendering.rb', line 4

def self.render_gfm(content)
  html = self.to_html(content, :gfm)
  html = add_level_and_heading(html)
  html
end