Commit 6b88de12 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Close unclosed pre/code tags (#4265).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3590 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 72031962
......@@ -439,6 +439,10 @@ module ApplicationHelper
parsed << full_tag
end
end
# Close any non closing tags
while tag = tags.pop
parsed << "</#{tag}>"
end
parsed
end
......
......@@ -324,6 +324,20 @@ EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
end
def test_non_closing_pre_blocks_should_be_closed
raw = <<-RAW
<pre><code>
RAW
expected = <<-EXPECTED
<pre><code>
</code></pre>
EXPECTED
@project = Project.find(1)
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
end
def test_syntax_highlight
raw = <<-RAW
<pre><code class="ruby">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment