Defect #1416

Inline code with less-then/greater-than produces @lt; and @gt; respectively

Added by Anonymous about 9 years ago. Updated about 4 years ago.

Status:ClosedStart date:2008-06-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:1.0.0 (RC)
Resolution:Fixed Affected version:

Description

I tried to put the following in inline code

<Location /redmine>
in a forum message and the result was <Location /redmine> e.g. <Location /redmine>

Is this expected? Looks like a bug to me.

  • Redmine-0.7.1
  • Rails-2.0.2
  • Ruby-1.8.6

redcloth_arobas.diff Magnifier (1.18 KB) Jean-Baptiste Barth, 2009-03-22 11:57

redcloth3_3.0.4_escape.diff Magnifier - Patch for Redcloth3 in conjunction with coderay 0.9.1 (1.34 KB) Anthony Groyer, 2010-02-26 18:09


Related issues

Duplicated by Redmine - Defect #2280: lesser symbol is printed as HTMLcode Closed 2008-12-05
Duplicated by Redmine - Defect #3020: Problem with wiki formatting for inline code with "@" cha... Closed 2009-03-21
Duplicated by Redmine - Defect #2922: bad escaping of < and > in code exemple in redmine Wiki Closed 2009-03-06
Duplicated by Redmine - Defect #4794: wiki rendering bug Closed 2010-02-10

Associated revisions

Revision 3567
Added by Jean-Philippe Lang over 7 years ago

Fixed: inline code with less-then/greater-than produces @lt; and @gt; (#1416).

History

#1 Updated by Brian Ericson about 9 years ago

Ran into the same thing. Simple workaround is to stop the inline, add the , and continue the inline (ending it at the next and resuming it afterward).

(ampersand)abc <123> xyz(ampersand) results in abc <123> xyz

(ampersand)abc(ampersand) <(ampersand)123(ampersand)> (ampersand) xyz(ampersand) gives you abc <123> xyz, which is what you want.

#2 Updated by Brian Ericson about 9 years ago

Sorry -- "@" is not an (ampersand). Also, "add the ," should be "add the < or > characters," (if you follow a less than immediately by a greater than, redmine appears to not show it).

#3 Updated by Jean-Baptiste Barth over 8 years ago

  • File redcloth_arobas.diffMagnifier added
  • Affected version (unused) deleted (0.7.1)
  • Affected version deleted (0.7.1)

The problem is redcloth parses twice these characters ; the first time it escapes all "<" and ">", no problem about that, but the second it traduces resulting "&lt;" to "&amp;lt;" (and so on), which is incorrect. It seems to me it's a redcloth problem, so I patched recloth lib to avoid second parsing. See attachment and let me know your opinion about that.

#4 Updated by Jean-Philippe Lang over 7 years ago

  • Category changed from Wiki to Text formatting

#5 Updated by Anthony Groyer over 7 years ago

This works fine for inline code with @ separators. For

 
separators, this does not work.
Why not considering moving to RedCloth 4 that apparently fixes these 2 issues ?

#6 Updated by Anthony Groyer over 7 years ago

This works fine for inline code with separators. For <pre> separators, this does not work.
Why not considering moving to RedCloth 4 that apparently fixes these 2 issues ?

#7 Updated by Anthony Groyer over 7 years ago

In fact, the bug I described (with pre separators) appears when I use coderay-0.9.1 (for java syntax coloration) that I have copied manually in redmine/vendor/plugins.
I attached a patch of redcloth3.rb that seems to work.

#8 Updated by Anthony Groyer over 7 years ago

Anthony Groyer wrote:

In fact, the bug I described (with pre separators) appears when I use coderay-0.9.1 (for java syntax coloration) that I have copied manually in redmine/vendor/plugins.
I attached a patch of redcloth3.rb that seems to work.

This patch solves the issue when the < and > are between a

<pre><code class="..."> </code>
tags but create a bug when they are used in
<pre> </pre>
tags.

#9 Updated by Jean-Philippe Lang over 7 years ago

  • Subject changed from Include code and less-then/greater-than produces @lt; and @gt; respectively to Inline code with less-then/greater-than produces @lt; and @gt; respectively
  • Status changed from New to Closed
  • Target version set to 1.0.0 (RC)
  • Resolution set to Fixed

The initial defect (< > inside inline code) is fixed by applying Jean-Baptiste's patch in r3567.
Anthony, your problem seems different and your patch breaks a few tests.

#10 Updated by Luc Vandenbroucke about 4 years ago

I do have about the same problem with lines starting with a space
like this

&lt;VLAN&gt;

Also available in: Atom PDF