Feature #20511
Comments for Textile text formatting
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Text formatting | |||
Target version: | 5.0.0 | |||
Resolution: | Fixed |
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!
Related issues
Associated revisions
Comments for Textile text formatting (#20511).
Patch by Go MAEDA.
History
#1
Updated by Serg Astra over 5 years ago
+1
#2
Updated by Joel SCHAAL over 5 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...
#3
Updated by David Lukas Müller over 1 year ago
+1
#4
Updated by Go MAEDA over 1 year ago
- Related to Feature #6269: RedCloth 4 support added
#5
Updated by Go MAEDA over 1 year ago
- Related to Feature #3564: Invisible comments added
#6
Updated by Go MAEDA 5 months 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
#7
Updated by Go MAEDA 4 months ago
- Related to Defect #1160: HMTL-Tags added
#8
Updated by Go MAEDA 4 months ago
- File 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.