Feature #20511
closedComments for Textile text formatting
0%
Description
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 is filtered and does not work.
Disfunctional Textile examples:
I know there is a plugin for this. I hope it will be made a core functionality soon. Cheers!
Files
Related issues
Updated by Joel SCHAAL almost 8 years ago
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).
Is Textile going to be abandoned in favor of Markdown ? I guess this issue would then be obsolete...
Updated by Go MAEDA almost 4 years ago
- Related to Feature #6269: RedCloth 4 support added
Updated by Go MAEDA almost 4 years ago
- Related to Feature #3564: Invisible comments added
Updated by Go MAEDA almost 3 years ago
+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.
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
Updated by Go MAEDA almost 3 years ago
- File 20511.patch 20511.patch added
- Target version set to Candidate for next major release
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.
Updated by Go MAEDA almost 3 years ago
- Target version changed from Candidate for next major release to 5.0.0
Setting the target version to 5.0.0.
Updated by Go MAEDA almost 3 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch.