Bug #3196

Code formatting interprets square brackets as wiki links.

Added by SquelchAdmin over 5 years ago. Updated almost 5 years ago.

Status:Expired Start date:07/30/2009
Priority:Urgent Due date:
Assignee:- % Done:

0%

Category:Code formatting
Target version:-
Close Reason: NGUrl:
BIForumURL: WIKIurl:

Description

While tring to format some code in CIT the user complained that some brackets were dropped.

the brackets are in fact there in the text input window, but fail to display correctly in rendered view.
issue #3195

should read

this setvariable ["townlist",[[[[position this, 200]]]]];

The wiki link double brackets is being interpreted inside code blocks as shown by the red invalid link. Edit this issue to see the workaround of adding extra square brackets to even display the correct code. Not something easy to do when pasting code.

This will mean all code blocks can potentially be wrong when rendered on DH.

History

Updated by SquelchAdmin over 5 years ago

  • Subject changed from Code formatting drops squre brackets to Code formatting interprets square brackets as wiki links.

Updated by kju over 5 years ago

  • Status changed from New to Feedback
  • Assignee changed from kju to Squelch

What can I do here to help?

Updated by Squelch over 5 years ago

I have looked at the code to see if a code block can be prevented from recognising a wiki link. My hope was code would ignore them, or they could be escaped, but I'm stuck. It looks to be a problem with either coderay, or redmine itself.

Updated by kju over 5 years ago

If you can guide me to the regex, i can look at it. :)

Updated by Squelch over 5 years ago

\vendor\plugins\coderay-0.8.3\lib\coderay\for_redcloth.rb

Line 16

I think this define deals with escaping and the regex could check for double square brackets.

 def unescape(html)
          replacements = {
            '&' => '&',
            '"' => '"',
            '>' => '>',
            '&lt;' => '<',
          }
          html.gsub(/&(?:amp|quot|[gl]t);/) { |entity| replacements[entity] }

Updated by Squelch over 5 years ago

  • Assignee changed from Squelch to kju

Updated by kju almost 5 years ago

  • Status changed from Feedback to Expired
  • Assignee deleted (kju)

Also available in: Atom PDF