Vote #80488
完了Right-aligned TOC tag is displayed in exported PDF if the text formatting setting is Markdown
0%
説明
Hello,
If we have a right toc :
{{>toc}}
In a wiki page on REDMINE with text formatting markdown.
The toc
{{>toc}}
Appear in the PDF
No problem for left toc.
Thanks
journals
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I modified the regular expression with reference to "TOC_RE":https://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/application_helper.rb#L1312 of app/helpers/application_helper.rb .
I confirmed that @{{toc}}@, @{{<toc}}@ and @{{>toc}}@ do not export to PDF.
<pre><code class="diff">
diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb
index c8189367b..0adcb18c7 100644
--- a/lib/redmine/export/pdf.rb
+++ b/lib/redmine/export/pdf.rb
@@ -92,7 +92,7 @@ module Redmine
</style>'
# Strip {{toc}} tags
- txt = txt.gsub(/<p>\{\{([<>]?)toc\}\}<\/p>/i, '')
+ txt = txt.gsub(/<p>\{\{((<|<)|(>|>))?toc\}\}<\/p>/i, '')
writeHTMLCell(w, h, x, y, css_tag + txt, border, ln, fill)
end
</code></pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Setting the target version to 4.0.7.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,Closed,16236,Right-aligned table of contents (TOC) not working with markdown