http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11514
Revision: 11514 Author: xqt Date: 2013-05-09 16:42:02 +0000 (Thu, 09 May 2013) Log Message: ----------- search for underline and blanks (maybe inside links)
Modified Paths: -------------- trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py =================================================================== --- trunk/pywikipedia/pywikibot/textlib.py 2013-05-09 16:24:54 UTC (rev 11513) +++ trunk/pywikipedia/pywikibot/textlib.py 2013-05-09 16:42:02 UTC (rev 11514) @@ -1073,6 +1073,7 @@ #----------------------------------
def does_text_contain_section(pagetext, section): + section = re.sub('[ _]', '[ _]', section) """Determines whether the page text contains the given section title.""" m = re.search("=+[ ']*%s[ ']*=+" % re.escape(section), pagetext) return bool(m)