def parse_googlemap(wikitext, detail=False):
"""Parses the (unicode) u'<googlemap ...>content</googlemap>' of the googlemap extension
- out of a page. If wikitext does not contain the googlemaps extension text None is returned.
+ out of a page. If wikitext does not contain the googlemap extension text None is returned.
If the googlemap contains invalid formatted lines, a RuntimeError is raised.
:param wikitext: wikitext containing the template. Example:
- :param detail: bool. If True, start and end position of <googlemaps>...</googlemap> is
+ :param detail: bool. If True, start and end position of <googlemap>...</googlemap> is
returned additionally.
wikitext = '''
if not match is None: return (float(match.group(2)), float(match.group(1)), None, None)
return RuntimeError(u'Could not parse line ' + line)
- regexp = re.compile(u"(<googlemap[^>]*>)(.*)(</googlemap>)", re.DOTALL)
+ regexp = re.compile(u"(<googlemap[^>]*>)(.*?)(</googlemap>)", re.DOTALL)
match = regexp.search(wikitext)
if match is None: return None
start = match.start()