プロジェクト

全般

プロフィール

Vote #80488

完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
160
issue_org_id:
32477
author_id:
49905
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
144
ステータス-->[Closed]

説明

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>\{\{((<|&lt;)|(>|&gt;))?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

Admin Redmine さんが約4年前に更新

  • カテゴリPDF export_39 にセット
  • 対象バージョン4.1.1_160 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0