Permalink
Browse files

list: Take higher priority than indented code

  • Loading branch information...
lu-zero committed May 28, 2015
1 parent de6d3b2 commit 76f4d77ae560c9d3eae31feb2ceb9168e3fd02e4
Showing with 14 additions and 14 deletions.
  1. +14 −14 CommonMark/CommonMark.py
View
@@ -1017,7 +1017,20 @@ def closeUnmatchedBlocks(self, already_done, oldtip):
data = self.parseListMarker(ln, first_nonspace)
indent = first_nonspace - offset
if indent >= CODE_INDENT:
if data:
already_done, oldtip = closeUnmatchedBlocks(
self, already_done, oldtip)
data['marker_offset'] = indent
offset = first_nonspace + data['padding']
if not container.t == "List" or not self.listsMatch(
container.list_data, data):
container = self.addChild(
"List", line_number, first_nonspace)
container.list_data = data
container = self.addChild(
"ListItem", line_number, first_nonspace)
container.list_data = data
elif indent >= CODE_INDENT:
if not self.tip.t == "Paragraph" and not blank:
offset += CODE_INDENT
already_done, oldtip = closeUnmatchedBlocks(
@@ -1109,19 +1122,6 @@ def closeUnmatchedBlocks(self, already_done, oldtip):
"HorizontalRule", line_number, first_nonspace)
offset = len(ln) - 1
break
elif data:
already_done, oldtip = closeUnmatchedBlocks(
self, already_done, oldtip)
data['marker_offset'] = indent
offset = first_nonspace + data['padding']
if not container.t == "List" or not self.listsMatch(
container.list_data, data):
container = self.addChild(
"List", line_number, first_nonspace)
container.list_data = data
container = self.addChild(
"ListItem", line_number, first_nonspace)
container.list_data = data
else:
break
if self.acceptsLines(container.t):

0 comments on commit 76f4d77

Please sign in to comment.