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