Commit 3381c75c authored by 's avatar

Fixed regexp bug in decapitate that caused some kinds of html to

be interpreted as headers.
parent eea29ad9
"""Document object"""
__version__='$Revision: 1.63 $'[11:-2]
__version__='$Revision: 1.64 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower
......@@ -285,13 +285,13 @@ class DocumentHandler:
def decapitate(html, RESPONSE=None,
header_re=regex.compile(
'\(\('
'[^\0- <>:]+:[^\n]*\n'
'[^\0\- <>:]+:[^\n]*\n'
'\|'
'[ \t]+[^\0- ][^\n]*\n'
'[ \t]+[^\0\- ][^\n]*\n'
'\)+\)[ \t]*\n\([\0-\377]+\)'
),
space_re=regex.compile('\([ \t]+\)'),
name_re=regex.compile('\([^\0- <>:]+\):\([^\n]*\)'),
name_re=regex.compile('\([^\0\- <>:]+\):\([^\n]*\)'),
):
if header_re.match(html) < 0: return html
......
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