Project

General

Profile

Actions

Defect #5687

closed

Redmine wiki formatting borks on yaml anchors

Added by Felix Schäfer almost 14 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
2010-06-14
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

e.g.:

someenv: &someenv
  - someattribute

someotherenv:
  - someotherattribute

The anchor &someenv gets in a <span class="s"> which is absolutely correct, but for some reason the redmine formatter starts another <span class="s"> immediately after that and closes it only at the end of the yaml "object".

The following shows coderay is not at fault here (run in script/console of a r3731 installation, so with coderay 0.9.2):

>> lestring = "someenv: &someenv
  - someattribute

someotherenv:
  - someotherattribute" 
=> "someenv: &someenv\n  - someattribute\n\nsomeotherenv:\n  - someotherattribute" 
>> require 'coderay'
=> true
>> CodeRay.scan(lestring, :yaml).html(:line_numbers => :inline, :wrap => :span)
=> "<span class=\"CodeRay\"><span class=\"no\">1</span> <span class=\"ke\">someenv</span>: <span class=\"v\">&amp;someenv</span>\n<span class=\"no\">2</span>   - <span class=\"s\">someattribute</span>\n<span class=\"no\">3</span> \n<span class=\"no\">4</span> <span class=\"ke\">someotherenv</span>:\n<span class=\"no\">5</span>   - <span class=\"s\">someotherattribute</span></span>" 
>> Redmine::WikiFormatting.to_html(Setting.text_formatting, "<pre><code class=\"yaml\">#{lestring}</code>< /pre>")
=> "<pre><code class=\"yaml syntaxhl\"><span class=\"CodeRay\"><span class=\"no\">1</span> <span class=\"ke\">someenv</span>: <span class=\"s\">&#38;someenv</span><span class=\"s\">\n<span class=\"no\">2</span>   - someattribute</span>\n<span class=\"no\">3</span> \n<span class=\"no\">4</span> <span class=\"ke\">someotherenv</span>:\n<span class=\"no\">5</span>   - <span class=\"s\">someotherattribute</span></span></code></pre>"

(Notice that I had to put a space in one of the < /pre> so as not to totally break the rendered version.)

Actions #1

Updated by Go MAEDA over 5 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

Since Redmine has migrated from CodeRay to Rouge in Redmine 4.0.0, this issue should have been resolved.

Actions #2

Updated by Go MAEDA over 5 years ago

  • Resolution changed from Wont fix to Fixed
Actions

Also available in: Atom PDF