Skip to content
Snippets Groups Projects
Commit 908ee5e4 authored by Florian Münchbach's avatar Florian Münchbach
Browse files

[syntax_highlight] More strict checking for multi-line code blocks

parent e419bfc1
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,8 @@ class ChatSyntaxHighlighter:
def find_multiline_matches(self, text):
start = None
matches = []
for i in re.finditer(r'\n?```(?:\S*\n)?', text, re.DOTALL):
#Less strict, allow prefixed whitespaces: for i in re.finditer(r'(?:^|\n)[ |\t]*(```)\S*[ |\t]*(?:\n|$)', text, re.DOTALL):
for i in re.finditer(r'(?:^|\n)(```)\S*(?:\n|$)', text, re.DOTALL):
if start is None:
start = i
elif re.match(r'^\n```', i.group(0)) is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment