Defect #9673
closedAngle brackets within 'pre' blocks are silently replaced by named HTML entities during wiki section-edit
0%
Description
I noticed this issue while working offline (read on my own test-box; also to test new features recently added to the core) on improvements for RedmineReceivingEmails.
What I did:
1. Copied the complete content of RedmineReceivingEmails to a wikipage in a project in my local Redmine instance (source:/trunk@7962)
2. Section-edited "Enabling anonymous users to create issues by email"-section and saved the page
Now, looking at the diff of the new page-version (and of course the actual page content), the angle brackets within the < pre >
blocks in the "Reading emails from standard input" and "Forwarding emails from your email server" sections are silently replaced by their named HTML entities substitutions (<
& >
).
After I found out the above I tried the same with a fresh (again local) copy of RedmineReceivingEmails but instead of section-editing I choose to regularly edit the whole wiki-page and still only make changes in the "Enabling anonymous users to create issues by email"-section.
This resulted in the correct behavior and made it sure to me that this issue is related to / happens only while using the recently introduced wiki section-editing feature.
I took it even one more step further by doing another section-edit (now on "How it works") and this resulted in the same incorrect behavior. That is, it now replaces the earlier inserted ampersands to his named HTML entitity substitution (&
). In that way it's consistent.
Although this happens on my local instance of Redmine I'm pretty sure it will happen on (currently updated) redmine.org too whenever I make these section-edits "in production".
Environment:- Redmine: source:/trunk@7962
- Ruby: 1.8.7 [x86_64-linux] (REE 1.8.7-2011.03)
- RubyGems: 1.3.7
- Rack: 1.1.2
- Rails: 2.3.14
- MySQL: 5.1.41
- Browser: Mozilla Firefox 7.0.1
Please let me know if more information is required.
Related issues
Updated by Mischa The Evil about 13 years ago
Can this be related to issue #9440?
Updated by Etienne Massip about 13 years ago
- Priority changed from High to Urgent
Updated by Jean-Philippe Lang about 13 years ago
- Status changed from New to Resolved
This should be fixed in r7969.
Updated by Etienne Massip about 13 years ago
I also noticed that trailing whitespaces are chopped, so you won't be able to insert as much space as you want to have at the end of the section and before the following section title.
Needs to be confirmed, though.
Updated by Mischa The Evil about 13 years ago
Jean-Philippe Lang wrote:
This should be fixed in r7969.
Confirmed. For the record, the introduced test (test_update_section_should_not_escape_pre_content_outside_section
, source:/trunk/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb@7969#L305) is scoped to test for escape issue in pre content outside section.
From what I can tell this commit also fixes this behavior for sections which are currently section-edited (thus inside section). Don't know though if it's a matter that should be changed.
Updated by Jean-Philippe Lang about 13 years ago
Etienne Massip wrote:
I also noticed that trailing whitespaces are chopped, so you won't be able to insert as much space as you want to have at the end of the section and before the following section title.
Indeed, additional white space are stripped when editing a section but I don't think it's a serious issue since multiple blank lines won't make any difference in the formatted text.
Mischa The Evil wrote:
Confirmed. For the record, the introduced test (
test_update_section_should_not_escape_pre_content_outside_section
, source:/trunk/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb@7969#L305) is scoped to test for escape issue in pre content outside section.
The test matches what you described in this ticket description (angle brackets escaped in the "Reading emails from standard input" when editing "Enabling anonymous users to create issues by email" which is an other section).
BTW, another fix was required for code tags inside pre blocks (see r7975).
Updated by Jean-Philippe Lang about 13 years ago
- Status changed from Resolved to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed