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!(/

\{\{([<>]?)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