]> source.dussan.org Git - redmine.git/commitdiff
Merged r11227 from trunk (#9842).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 20 Jan 2013 17:06:46 +0000 (17:06 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 20 Jan 2013 17:06:46 +0000 (17:06 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11235 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf.rb

index 3a246cfc2aa9d60636c462e9f2179ba3c47bce59..6c1d9ef2b9b6e99f3dfa275179b707f74f023f95 100644 (file)
@@ -109,6 +109,13 @@ module Redmine
           RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
         end
 
+        def formatted_text(text)
+          html = Redmine::WikiFormatting.to_html(Setting.text_formatting, text)
+          # Strip {{toc}} tags
+          html.gsub!(/<p>\{\{([<>]?)toc\}\}<\/p>/i, '')
+          html
+        end
+
         def RDMCell(w ,h=0, txt='', border=0, ln=0, align='', fill=0, link='')
           Cell(w, h, fix_text_encoding(txt), border, ln, align, fill, link)
         end
@@ -120,8 +127,7 @@ module Redmine
         def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0)
           @attachments = attachments
           writeHTMLCell(w, h, x, y,
-            fix_text_encoding(
-              Redmine::WikiFormatting.to_html(Setting.text_formatting, txt)),
+            fix_text_encoding(formatted_text(txt)),
             border, ln, fill)
         end