We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b27d3d2 commit 86904baCopy full SHA for 86904ba
1 file changed
textile/core.py
@@ -457,18 +457,14 @@ def fTextileList(self, match):
457
except IndexError:
458
nextline = ''
459
460
- m = re.search(r"^([#*;:]+)(_|\d+)?({0})[ .](.*)$".format(cls_re_s),
461
- line, re.S)
+ m = re.search(r"^(?P<tl>[#*;:]+)(?P<st>_|\d+)?(?P<atts>{0})[ .]"
+ "(?P<content>.*)$".format(cls_re_s), line, re.S)
462
tl, start, atts, content = m.groups()
463
content = content.strip()
464
nl = ''
465
ltype = list_type(tl)
466
- if ';' in tl:
467
- litem = 'dt'
468
- elif ':' in tl:
469
- litem = 'dd'
470
- else:
471
- litem = 'li'
+ tl_tags = {';': 'dt', ':': 'dd'}
+ litem = tl_tags.get(tl[0], 'li')
472
473
showitem = len(content) > 0
474
0 commit comments