lib/jsduck/format/doc.rb in jsduck-5.0.0.beta3 vs lib/jsduck/format/doc.rb in jsduck-5.0.0.beta4
- old
+ new
@@ -73,10 +73,10 @@
# on its own line. But in that case RDiscount doesn't recognize
# it as the beginning of <pre>-block and goes on parsing it as
# normal Markdown, which often causes nested <pre>-blocks.
#
# To prevent this, we always add extra newline before <pre>.
- input.gsub!(/([^\n])<pre>/, "\\1\n<pre>")
+ input.gsub!(/([^\n])<pre>((<code>)?$)/, "\\1\n<pre>\\2")
# But we remove trailing newline after <pre> to prevent
# code-blocks beginning with empty line.
input.gsub!(/<pre>(<code>)?\n?/, "<pre>\\1")