in migration/src/markup/text_effects.py [0:0]
def action(self, tokens: ParseResults) -> str:
text = self.markup.transformString("\n".join([line.lstrip() for line in tokens[0].strip().splitlines()]))
# escape numbered list in quotes.
# e.g.,
# {quote}
# 2. foo
# 5. bar
# {quote}
# should be
# > 2\\. foo
# > 5\\. bar
pat_ordered_list = re.compile(r"((?<=^\d)||(?<=^\d\d))\.")
return "\n".join(["> " + re.sub(pat_ordered_list, '\.', line) for line in text.splitlines()]) + "\n" # needs additional line feed at the end of quotation to preserve indentation