Pre Chunk-Handler gets confused when XML parser converts empty elements to short-tag syntax.

Reported by Andrew Stacey.
This commit is contained in:
Jacques Distler 2011-08-23 14:35:27 -05:00
parent e387d095ec
commit 903c4b6bdd
3 changed files with 19 additions and 1 deletions

View file

@ -18,7 +18,7 @@ module Literal
# A literal chunk that protects 'code' and 'pre' tags from wiki rendering.
class Pre < AbstractLiteral
PRE_BLOCKS = "a|pre|code|math"
PRE_PATTERN = Regexp.new('<('+PRE_BLOCKS+')\b[^>]*?>.*?</\1>', Regexp::MULTILINE)
PRE_PATTERN = Regexp.new('<('+PRE_BLOCKS+')\b[^>]*?(>.*?</\1>|/>)', Regexp::MULTILINE)
def self.pattern() PRE_PATTERN end
end