From 9a202f7fb21e45467edbab7a329a50e9977c14b3 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 28 Aug 2023 20:45:07 -0700 Subject: [PATCH] Prevent
. - if re.search(r'(\d+\.?)$', result): + # removed to force a
. + if re.search(r'(\n\d+\.?|\n\*\s*)$', result): delete_str = '|delete|' - if not result.endswith('.'): + if re.search(r'(\d+\.?)$', result) and not result.endswith('.'): result += '.' - result = re.sub(r'(\d+\.)$', r'\g<1> ' + delete_str, result) + result = re.sub(r'(\n\d+\.?|\n\*\s*)$', r'\g<1> ' + delete_str, result) html_output = markdown.markdown(result, extensions=['fenced_code', 'tables']) pos = html_output.rfind(delete_str)