Project

General

Profile

Actions

Defect #9673

closed

Angle brackets within 'pre' blocks are silently replaced by named HTML entities during wiki section-edit

Added by Mischa The Evil almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Urgent
Category:
Wiki
Target version:
-
Start date:
2011-11-28
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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 (&lt; & &gt;).

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 (&amp;). 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

Related to Redmine - Feature #2222: Single section edit. ClosedJean-Philippe Lang2008-11-21

Actions
Actions #1

Updated by Mischa The Evil almost 13 years ago

Can this be related to issue #9440?

Actions #2

Updated by Etienne Massip almost 13 years ago

  • Priority changed from High to Urgent
Actions #3

Updated by Jean-Philippe Lang almost 13 years ago

  • Status changed from New to Resolved

This should be fixed in r7969.

Actions #4

Updated by Etienne Massip almost 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.

Actions #5

Updated by Mischa The Evil almost 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.

Actions #6

Updated by Jean-Philippe Lang almost 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).

Actions #7

Updated by Jean-Philippe Lang almost 13 years ago

And another fix in r7976.

Actions #8

Updated by Jean-Philippe Lang almost 13 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed
Actions #9

Updated by Mischa The Evil almost 13 years ago

Mischa The Evil wrote:

Can this be related to issue #9440?

It wasn't.

Actions

Also available in: Atom PDF