Reparse redfam-heading with mwparser

See related ticked for detailed failure explanation

Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=77 FS#77]
This commit is contained in:
2016-08-24 19:57:25 +02:00
parent fe2810f07c
commit 1e4c8646bf

View File

@@ -210,13 +210,14 @@ class RedFamParser( RedFam ):
@type heading wikicode or mwparser-parseable @type heading wikicode or mwparser-parseable
""" """
# Parse heading with mwparse if needed
if not isinstance( heading, mwparser.wikicode.Wikicode ):
heading = mwparser.parse( heading )
# Save heading as string # Save heading as string
self._heading = str( heading ) self._heading = str( heading )
# Parse string heading with mwparse again everytime
# In some cases the given wikicode is broken due to syntax errors
# (Task FS#77)
heading = mwparser.parse( self._heading )
# Save destinations of wikilinks in headings # Save destinations of wikilinks in headings
self._articlesList = [ str( link.title ) for link self._articlesList = [ str( link.title ) for link
in heading.ifilter_wikilinks() ] in heading.ifilter_wikilinks() ]