Actions
Defect #5687
closedRedmine wiki formatting borks on yaml anchors
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\">&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\">&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