Strip {{toc}} tags in pdf exports (#9842).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11227 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
15f035be51
commit
d0888b2f71
|
@ -112,6 +112,13 @@ module Redmine
|
||||||
RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
|
RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
|
||||||
end
|
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
|
# Encodes an UTF-8 string to UTF-16BE
|
||||||
def to_utf16(str)
|
def to_utf16(str)
|
||||||
if str.respond_to?(:encode)
|
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)
|
def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0)
|
||||||
@attachments = attachments
|
@attachments = attachments
|
||||||
writeHTMLCell(w, h, x, y,
|
writeHTMLCell(w, h, x, y,
|
||||||
fix_text_encoding(
|
fix_text_encoding(formatted_text(txt)),
|
||||||
Redmine::WikiFormatting.to_html(Setting.text_formatting, txt)),
|
|
||||||
border, ln, fill)
|
border, ln, fill)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue