Close unclosed pre/code tags (#4265).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3590 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7203196212
commit
6b88de1234
|
@ -439,6 +439,10 @@ module ApplicationHelper
|
||||||
parsed << full_tag
|
parsed << full_tag
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# Close any non closing tags
|
||||||
|
while tag = tags.pop
|
||||||
|
parsed << "</#{tag}>"
|
||||||
|
end
|
||||||
parsed
|
parsed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -324,6 +324,20 @@ EXPECTED
|
||||||
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
|
||||||
end
|
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
|
def test_syntax_highlight
|
||||||
raw = <<-RAW
|
raw = <<-RAW
|
||||||
<pre><code class="ruby">
|
<pre><code class="ruby">
|
||||||
|
|
Loading…
Reference in New Issue