mbakeranalecta / sam

Semantic Authoring Markdown
Other
79 stars 8 forks source link

ampersand symbol inside definition list labels will cause error #107

Closed dram closed 7 years ago

dram commented 7 years ago

For following example:

section: foo

  |foo1 & bar1| foobar1
  |foo2 & bar2| foobar2
  |foo3 & bar3| foobar3

SAM parser will report following error:

Traceback (most recent call last):
  File "samparser.py", line 2067, in <module>
    xml_doc = etree.fromstring(xml_string)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:79010)
  File "src/lxml/parser.pxi", line 1848, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118341)
  File "src/lxml/parser.pxi", line 1736, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:117021)
  File "src/lxml/parser.pxi", line 1102, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:111265)
  File "src/lxml/parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:105109)
  File "src/lxml/parser.pxi", line 706, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:106817)
  File "src/lxml/parser.pxi", line 635, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:105671)
  File "<string>", line 6
lxml.etree.XMLSyntaxError: xmlParseEntityRef: no name, line 6, column 14
mbakeranalecta commented 7 years ago

Adressed in bd74ca0a23e26237942499ea6332c6005a013cb6.

serialize_xml() was not being called on the text of the label. Test added to test1.sam. All test passing.

dram commented 7 years ago

Fix confirmed, thanks!