Project

General

Profile

Defect #5445 » formatter.rb.diff

Yuki Kita, 2010-05-25 15:52

View differences:

lib/redmine/wiki_formatting/textile/formatter.rb (working copy)
63 63
        
64 64
        # Patch to add 'table of content' support to RedCloth
65 65
        def textile_p_withtoc(tag, atts, cite, content)
66
          # removes wiki links from the item
67
          toc_item = content.gsub(/(\[\[([^\]\|]*)(\|([^\]]*))?\]\])/) { $4 || $2 }
66
          # removes wiki links and textile links from the item
67
          toc_item = content.gsub(/(\[\[([^\]\|]*)(\|([^\]]*))?\]\])/) { $4 || $2 }.gsub(LINK_RE) { $4 }
68 68
          # removes styles
69 69
          # eg. %{color:red}Triggers% => Triggers
70 70
          toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
(2-2/5)