Project

General

Profile

Actions

Defect #32477

closed

Right-aligned TOC tag is displayed in exported PDF if the text formatting setting is Markdown

Added by Brice Beaumesnil over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
PDF export
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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


Files

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

Related issues

Related to Redmine - Defect #16236: Right-aligned table of contents (TOC) not working with markdownClosedJean-Philippe Lang

Actions
Actions #1

Updated by Go MAEDA over 4 years ago

  • Category changed from Wiki to PDF export
  • Status changed from New to Confirmed
Actions #2

Updated by Go MAEDA over 4 years ago

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

Updated by Yuichi HARADA over 4 years 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

Actions #4

Updated by Go MAEDA over 4 years ago

  • Target version set to Candidate for next minor release
Actions #5

Updated by Go MAEDA about 4 years ago

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

Setting the target version to 4.0.7.

Actions #6

Updated by Go MAEDA about 4 years ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch.

Actions #7

Updated by Go MAEDA about 4 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 4.0.7 to 4.1.1
Actions #8

Updated by Go MAEDA about 4 years ago

  • Subject changed from Export PDF of WikiPage in Markdown Format with right toc to Right-aligned TOC tag is displayed in exported PDF if the text formatting setting is Markdown
Actions

Also available in: Atom PDF