Rewrite RedPage.parse using mwparserfromhell to make it simpler
This commit is contained in:
@@ -126,8 +126,8 @@ class RedFamParser( RedFam ):
|
||||
__timestamp_format = jogobot.config['redundances']['timestamp_format']
|
||||
|
||||
# Define section heading re.pattern
|
||||
__sectionhead_pat = re.compile( r"^(=+)(.*\[\[.+\]\].*\[\[.+\]\].*)\1" )
|
||||
|
||||
__sectionhead_pat = re.compile( r"^(.*\[\[.+\]\].*\[\[.+\]\].*)" )
|
||||
|
||||
# Define timestamp re.pattern
|
||||
__timestamp_pat = re.compile( jogobot.config['redundances']
|
||||
['timestamp_regex'] )
|
||||
@@ -333,8 +333,8 @@ class RedFamParser( RedFam ):
|
||||
|
||||
@returns bool Returns True if it is a section heading
|
||||
"""
|
||||
|
||||
if cls.__sectionhead_pat.search( line ):
|
||||
|
||||
if cls.__sectionhead_pat.search( str(line) ):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user