Loading lib/jsduck/guides.rb +6 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,9 @@ module JsDuck html.each_line do |line| if line =~ /^<h2>(.*)<\/h2>$/ i += 1 toc << "<li><a href='#!/guide/#{guide['name']}-section-#{i}'>#{$1}</a></li>\n" new_html << "<h2 id='#{guide['name']}-section-#{i}'>#{$1}</h2>\n" text = strip_tags($1) toc << "<li><a href='#!/guide/#{guide['name']}-section-#{i}'>#{text}</a></li>\n" new_html << "<h2 id='#{guide['name']}-section-#{i}'>#{text}</h2>\n" else new_html << line end Loading Loading @@ -151,6 +152,9 @@ module JsDuck "guides/" + guide["name"] + "/icon.png" end def strip_tags(str) str.gsub(/<.*?>/, "") end end end Loading
lib/jsduck/guides.rb +6 −2 Original line number Diff line number Diff line Loading @@ -111,8 +111,9 @@ module JsDuck html.each_line do |line| if line =~ /^<h2>(.*)<\/h2>$/ i += 1 toc << "<li><a href='#!/guide/#{guide['name']}-section-#{i}'>#{$1}</a></li>\n" new_html << "<h2 id='#{guide['name']}-section-#{i}'>#{$1}</h2>\n" text = strip_tags($1) toc << "<li><a href='#!/guide/#{guide['name']}-section-#{i}'>#{text}</a></li>\n" new_html << "<h2 id='#{guide['name']}-section-#{i}'>#{text}</h2>\n" else new_html << line end Loading Loading @@ -151,6 +152,9 @@ module JsDuck "guides/" + guide["name"] + "/icon.png" end def strip_tags(str) str.gsub(/<.*?>/, "") end end end