Skip to content

Commit 3088cf4

Browse files
authored
Fix invalid regex in scripts/python/md-split.py (#2303)
The `[` character doesn't need to be escaped. The `]` character needs to be escaped as `\\]` or as `\]` in a raw string.
1 parent ee52a86 commit 3088cf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/python/md-split.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def is_inside_code(line, indent_depth):
181181
def stripped(line):
182182
# Remove well-formed html tags, fixing mistakes by legitimate users
183183
sline = TAG_REGEX.sub('', line)
184-
sline = re.sub('[()\[\]#*]', ' ', line)
184+
sline = re.sub(r'[()[\]#*]', ' ', line)
185185
return sline
186186

187187
def dedent(line, indent_depth):

0 commit comments

Comments
 (0)