diff --git a/textile/core.py b/textile/core.py index d580bc6f..88da32b9 100644 --- a/textile/core.py +++ b/textile/core.py @@ -436,7 +436,11 @@ def hasRawText(self, text): True """ - r = re.compile(r'<(p|blockquote|div|form|table|ul|ol|dl|pre|h\d)[^>]*?>.*', + # The php version has orders the below list of tags differently. The + # important thing to note here is that the pre must occur before the + # p or else the regex module doesn't properly match pre-s. It only + # matches the p in pre. + r = re.compile(r'<(pre|p|blockquote|div|form|table|ul|ol|dl|h[1-6])[^>]*?>.*', re.S).sub('', text.strip()).strip() r = re.compile(r'<(hr|br)[^>]*?/>').sub('', r) return '' != r diff --git a/textile/version.py b/textile/version.py index 8ec4737c..5a099d96 100644 --- a/textile/version.py +++ b/textile/version.py @@ -1 +1 @@ -VERSION = '2.2.1' +VERSION = '2.2.2'