##// END OF EJS Templates
Strip {{toc}} tags in pdf exports (#9842)....
Jean-Philippe Lang -
r10997:d0888b2f7199
parent child
Show More
@@ -112,6 +112,13 module Redmine
112 RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
112 RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
113 end
113 end
114
114
115 def formatted_text(text)
116 html = Redmine::WikiFormatting.to_html(Setting.text_formatting, text)
117 # Strip {{toc}} tags
118 html.gsub!(/<p>\{\{([<>]?)toc\}\}<\/p>/i, '')
119 html
120 end
121
115 # Encodes an UTF-8 string to UTF-16BE
122 # Encodes an UTF-8 string to UTF-16BE
116 def to_utf16(str)
123 def to_utf16(str)
117 if str.respond_to?(:encode)
124 if str.respond_to?(:encode)
@@ -132,8 +139,7 module Redmine
132 def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0)
139 def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0)
133 @attachments = attachments
140 @attachments = attachments
134 writeHTMLCell(w, h, x, y,
141 writeHTMLCell(w, h, x, y,
135 fix_text_encoding(
142 fix_text_encoding(formatted_text(txt)),
136 Redmine::WikiFormatting.to_html(Setting.text_formatting, txt)),
137 border, ln, fill)
143 border, ln, fill)
138 end
144 end
139
145
General Comments 0
You need to be logged in to leave comments. Login now