class Playbook::Markdown::HTMLBlockCode
def header(title, level)
def header(title, level) if level == 7 @headers ||= [] permalink = title.gsub(/\W+/, "-") if @headers.include?(permalink) permalink += "_1" loop do break unless @headers.include?(permalink) permalink.gsub!(/_(\d+)$/, "_#{Regexp.last_match(1).to_i + 1}") end end @headers << permalink %(\n<a name="#{permalink}" class="markdown-header-anchor anchor" href="##{permalink}"><span class="fa fa-link anchor-icon"></span></a><h#{level} id=\"#{permalink}\">#{title}</h#{level}>\n) else %(\n<h#{level}>#{title}</h#{level}>\n) end end