Anonymous committed 4b78aa0

Added quoting to AttributeList element attributes (single quoting attribute value causes them to be substituted like normal inline text).

  • Participants
  • Parent commits 8f84996

Comments (0)

Files changed (1)

     def translate():
         assert is AttributeList   # Discard attribute list from reader.
+        attrlist = {}
         d = AttributeList.match.groupdict()
         for k,v in d.items():
             if v is not None:
                 if k == 'attrlist':
                     v = subs_attrs(v)
                     if v:
-                        parse_attributes(v, AttributeList.attrs)
+                        parse_attributes(v, attrlist)
                     AttributeList.attrs[k] = v
+        # Substitute single quoted attribute values.
+        reo = re.compile(r"^'.*'$")
+        for k,v in attrlist.items():
+            if reo.match(v):
+                attrlist[k] = Lex.subs_1(v[1:-1],SUBS_NORMAL)
+        AttributeList.attrs.update(attrlist)
     def consume(d):
         """Add attribute list to the dictionary 'd' and reset the