Added check for color.
[philipp/winterrodeln/wrpylib.git] / wrpylib / wrmwmarkup.py
index c968b20d4005453f620b2d32bd33599c74117db4..142512ebaff6695823cb9bc211686dcad15f7394 100644 (file)
@@ -450,7 +450,8 @@ def parse_wrmap(wikitext):
             if len(wrong_properties) > 0:
                 raise RuntimeError("The attribute '{}' is not allowed at <{}>.".format(list(wrong_properties)[0], feature.tag))
             if feature.attrib.has_key('farbe'): 
-                # TODO: check value
+                if not re.match('#[0-9a-fA-F]{6}$', feature.attrib['farbe']):
+                    raise RuntimeError('The attribute "farbe" has to have a format like "#a0bb43".')
                 properties['strokeColor'] = feature.attrib['farbe'] # e.g. #a200b7
             if feature.attrib.has_key('dicke'):
                 try: