jph00 DanielCL commited on
Commit
8789604
1 Parent(s): bd669c9

changes to tolerant when there is a `.` inside the image name before `.png` or `.jpeg` (#5)

Browse files

- changes to tolerant when there is a `.` inside the image name before `.png` or `.jpeg` (54cb89ff6d5d4895125230953c9e2504e54f766b)


Co-authored-by: Liao <DanielCL@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -12,7 +12,7 @@ def fix_imgs(src, dst):
12
  return f'![{x.group(1)}|{sz}]({nm})'
13
  else: return f'MISSING IMAGE: {x.group(1)}'
14
 
15
- return re.sub(r'!\[\[([^.]+)\.\w+(\|\d+)?\]\]', repl_img, dst)
16
 
17
  def fix_imgs_with_hide(src, dst):
18
  if dst != "":
12
  return f'![{x.group(1)}|{sz}]({nm})'
13
  else: return f'MISSING IMAGE: {x.group(1)}'
14
 
15
+ result = re.sub(r'!\[\[(\S+)\.(png|jpeg)(\|\d+)?\]\]', repl_img, dst)
16
 
17
  def fix_imgs_with_hide(src, dst):
18
  if dst != "":