summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 16:22:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 16:22:20 +0000
commitd0888b2f719956a3156af6fced1b98c60675f06a (patch)
treefc359db62750d69a5a566c469d4b6f35c9dcccca /lib
parent15f035be518d65f6a8debed0dd19d58190e8b492 (diff)
downloadredmine-d0888b2f719956a3156af6fced1b98c60675f06a.tar.gz
redmine-d0888b2f719956a3156af6fced1b98c60675f06a.zip
Strip {{toc}} tags in pdf exports (#9842).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11227 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/export/pdf.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb
index ff3993f72..d0edd6f67 100644
--- a/lib/redmine/export/pdf.rb
+++ b/lib/redmine/export/pdf.rb
@@ -112,6 +112,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
+
# Encodes an UTF-8 string to UTF-16BE
def to_utf16(str)
if str.respond_to?(:encode)
@@ -132,8 +139,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