Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Allan Nordhøy
gajim-plugins
Commits
908ee5e4
Commit
908ee5e4
authored
6 years ago
by
Florian Münchbach
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
syntax_highlight/chat_syntax_highlighter.py
+2
-1
2 additions, 1 deletion
syntax_highlight/chat_syntax_highlighter.py
with
2 additions
and
1 deletion
syntax_highlight/chat_syntax_highlighter.py
+
2
−
1
View file @
908ee5e4
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment