Skip to content

Commit

Permalink
Addressing issue #107. Test are passing in master.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbakeranalecta committed Mar 28, 2017
1 parent e13039d commit bd74ca0
Show file tree
Hide file tree
Showing 3 changed files with 4,114 additions and 266 deletions.
8 changes: 5 additions & 3 deletions samparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _labeled_list_item(self, context):
label = match.group("label")
content_start = match.start("content") + 1
attributes = parse_attributes(match.group("attributes"))
self.doc.new_labeled_list_item(indent, label, attributes, content_start)
self.doc.new_labeled_list_item(indent, para_parser.parse(label, self.doc), attributes, content_start)
self.current_text_block = TextBlock(str(match.group("content")).strip())
return "PARAGRAPH", context

Expand Down Expand Up @@ -791,7 +791,9 @@ def serialize_xml(self):
for key, value in sorted(self.attributes.items()):
yield " {0}=\"{1}\"".format(key, value)

yield "<label>" + self.label + "</label>\n"
yield "<label>"
yield from self.label.serialize_xml()
yield "</label>\n"
for x in self.children:
if x is not None:
yield from x.serialize_xml()
Expand Down Expand Up @@ -1205,7 +1207,7 @@ def new_ordered_list_item(self, indent, attributes, content_start):
self.add_block(p)

def new_labeled_list_item(self, indent, label, attributes, content_start):
lli = LabeledListItem(indent, label, attributes, para_parser.parse(label, self.doc))
lli = LabeledListItem(indent, label, attributes)
self.add_block(lli)
p = Paragraph(content_start)
self.add_block(p)
Expand Down
Loading

0 comments on commit bd74ca0

Please sign in to comment.