プロジェクト

全般

プロフィール

Vote #76645

完了

Comments for Textile text formatting

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
26
version_id:
155
issue_org_id:
20511
author_id:
131816
assigned_to_id:
332
comments:
10
status_id:
5
tracker_id:
2
plus1:
3
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Developing and maintaining a wiki page I often would like to add some hidden commentary which does not show in formatted view.

I think there is no way to do this at the moment. Code for "Textile Comments":http://txstyle.org/doc/40/textile-comments is filtered and does not work.
 

Disfunctional Textile examples:

comment block

multi-line comment block

commented out block

 

I know there is a plugin for this. I hope it will be made a core functionality soon. Cheers!


journals

+1
--------------------------------------------------------------------------------
I stumbled across the same issue today, and wondered what I was doing wrong.
This marks Textile as not fully supported by Redmine for me (contrarily to what is written here: "Wiki formatting > Text formatting":https://redmine.dwos.com/help/en-gb/wiki_syntax_detailed_textile.html#5).

Is Textile going to be abandoned in favor of Markdown ? I guess this issue would then be obsolete...
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
CommonMark Markdown (#32424) that is going to be introduced in Redmine 5.0.0 supports HTML comments. I think it would be nice if Textile supports HTML comments as well.

The following code adds HTML comments support to the Textile formatter.

<pre><code class="diff">
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index 2816e1c90..274f9cef8 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -298,6 +298,7 @@ class RedCloth3 < String
@pre_list = []
rip_offtags text
no_textile text
+ clean_html_comment text
escape_html_tags text
# need to do this before #hard_break and #blocks
block_textile_quotes text unless @lite_mode
@@ -1217,4 +1218,8 @@ class RedCloth3 < String
end
end
end
+
+ def clean_html_comment(text)
+ text.gsub!(/^<!--[\s\S]*?-->$/, '')
+ end
end
</code></pre>

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Here is a patch.

HTML comments in Textile are escaped since r1403. This patch may appear to roll back that change, but I think it is not a problem. This is because the purpose of the change is to prevent mistakenly entered unclosed comments from affecting page rendering (see #1160) and unclosed comments are still escaped even after applying the patch. It is ensured by the test source:trunk/test/helpers/application_helper_test.rb@21440#L1304.
--------------------------------------------------------------------------------
Setting the target version to 5.0.0.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------


related_issues

relates,New,6269,RedCloth 4 support
relates,Closed,3564,Invisible comments
relates,Closed,1160,HMTL-Tags

Admin Redmine さんが3年以上前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョン5.0.0_155 にセット

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

いいね!0
いいね!0