Defect #32477

Export PDF of WikiPage in Markdown Format with right toc

Added by Brice Beaumesnil 2 months ago. Updated 3 days ago.

Status:ConfirmedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:PDF export
Target version:4.0.7
Resolution: Affected version:3.4.8

Description

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

Wiki.pdf (94.7 KB) Brice Beaumesnil, 2019-11-15 10:37


Related issues

Related to Redmine - Defect #16236: Right-aligned table of contents (TOC) not working with ma... Closed

History

#1 Updated by Go MAEDA about 1 month ago

  • Category changed from Wiki to PDF export
  • Status changed from New to Confirmed

#2 Updated by Go MAEDA about 1 month ago

  • Related to Defect #16236: Right-aligned table of contents (TOC) not working with markdown added

#3 Updated by Yuichi HARADA about 1 month ago

I modified the regular expression with reference to TOC_RE of app/helpers/application_helper.rb .
I confirmed that {{toc}}, {{<toc}} and {{>toc}} do not export to PDF.

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>\{\{((<|&lt;)|(>|&gt;))?toc\}\}<\/p>/i, '')
           writeHTMLCell(w, h, x, y, css_tag + txt, border, ln, fill)
         end

#4 Updated by Go MAEDA about 1 month ago

  • Target version set to Candidate for next minor release

#5 Updated by Go MAEDA 3 days ago

  • Target version changed from Candidate for next minor release to 4.0.7

Setting the target version to 4.0.7.

Also available in: Atom PDF