class Amber::Render::RegexTableOfContents

REGEX TOC

Constants

HEADING_EX

Public Instance Methods

to_html() click to toggle source
Calls superclass method Amber::Render::TableOfContents#to_html
# File lib/amber/render/table_of_contents.rb, line 170
def to_html
  super
  @new_html
end
to_toc() click to toggle source
Calls superclass method Amber::Render::TableOfContents#to_toc
# File lib/amber/render/table_of_contents.rb, line 175
def to_toc
  super
  @toc.to_html(@options)
end

Private Instance Methods

each_heading(html) { |$2, $3| ... } click to toggle source
# File lib/amber/render/table_of_contents.rb, line 188
def each_heading(html, &block)
  @new_html = html.gsub(HEADING_EX) do |match|
    "<%s>%s</%s>" % [$1, yield($2, $3), $2]
  end
end