Strip leading and trailing whitespace in Links to prevent wrong fam_hashes (when receiving redfam from db) since MySQL drops it
This commit is contained in:
@@ -210,13 +210,15 @@ class RedFamParser( RedFam ):
|
|||||||
# Parse content of heading for generating section links later
|
# Parse content of heading for generating section links later
|
||||||
match = type( self ).__sectionhead_pat.search( heading )
|
match = type( self ).__sectionhead_pat.search( heading )
|
||||||
if match:
|
if match:
|
||||||
self._heading = match.group(2).lstrip()
|
self._heading = match.group(2).strip()
|
||||||
else:
|
else:
|
||||||
raise RedFamHeadingError( heading )
|
raise RedFamHeadingError( heading )
|
||||||
|
|
||||||
# We get the pages in first [0] element iterating over
|
# We get the pages in first [0] element iterating over
|
||||||
# wikilink_pat.findall( line )
|
# wikilink_pat.findall( line )
|
||||||
self._articlesList = [ link[0] for link
|
# Strip leading and trailing whitespace in Links to prevent wrong
|
||||||
|
# fam_hashes (when receiving redfam from db) since MySQL drops it
|
||||||
|
self._articlesList = [ link.strip() for link
|
||||||
in wikilink_pat.findall( self._heading ) ]
|
in wikilink_pat.findall( self._heading ) ]
|
||||||
|
|
||||||
# Catch sections with more then 8 articles, print error
|
# Catch sections with more then 8 articles, print error
|
||||||
|
|||||||
Reference in New Issue
Block a user