def parse_wrmap(wikitext):
- """Parses the (unicode) u'<wrmap ...>content</wrmap>' of the Winterrodeln wrmap extension.
+ """Parses the '<wrmap ...>content</wrmap>' of the Winterrodeln wrmap extension.
If wikitext does not contain the <wrmap> tag or if the <wrmap> tag contains
invalid formatted lines, a ParseError is raised.
Use wrpylib.mwmarkup.find_tag(wikitext, 'wrmap') to find the wrmap tag within an arbitrary
:param wikitext: wikitext containing only the template. Example:
- wikitext = u'''
+ wikitext = '''
<wrmap lat="47.2417134" lon="11.21408895" zoom="14" width="700" height="400">
<gasthaus name="Rosskogelhütte" wiki="Rosskogelhütte">47.240689 11.190454</gasthaus>
<parkplatz>47.245789 11.238971</parkplatz>
"""
# parse XML
try:
- wrmap_xml = xml.etree.ElementTree.fromstring(wikitext.encode('utf-8'))
+ wrmap_xml = xml.etree.ElementTree.fromstring(wikitext)
except xml.etree.ElementTree.ParseError as e:
row, column = e.position
raise ParseError("XML parse error on row {}, column {}: {}".format(row, column, e))