OSDN Git Service

Add automatic HTML id attributes to markdown headings to allow linking
authormiks <miks@cubesystems.lv>
Thu, 26 Jul 2012 08:47:17 +0000 (11:47 +0300)
committermiks <miks@cubesystems.lv>
Thu, 26 Jul 2012 08:47:17 +0000 (11:47 +0300)
to content sections in wiki

app/helpers/application_helper.rb

index 3f15fd9..ce1ff15 100644 (file)
@@ -43,7 +43,7 @@ module ApplicationHelper
   end
 
   def markdown(text)
-    @__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(filter_html: true), {
+    @__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new({ filter_html: true, with_toc_data: true }), {
       no_intra_emphasis: true,
       tables: true,
       fenced_code_blocks: true,