Skip to content

Commit ef0dfad

Browse files
Normalize images
1 parent f30eb32 commit ef0dfad

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

‎.github/workflows/normalize-images.yml‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,20 +240,21 @@ jobs:
240240
# 2.5) GitBook hint blocks → Gutenberg blockquote
241241
s = convert_hint_blocks(s)
242242
243-
# s = replace_all_bold(s)
244-
245-
# 2.6) Sanitize ANY Markdown image URL (fix spaces, stray '>', etc.)
243+
# 2.6) Sanitize ANY Markdown image URL (fix spaces, stray '>', etc.)
246244
md_img_any = re.compile(
247-
r'!\[([^\]]*)\]' # group 1: alt
248-
r'\('
249-
r'\s*<?'
250-
r'([^)\r\n]+?)' # group 2: raw URL (no backref, we’ll clean it)
251-
r'>?' # allow a dangling '>' but don't capture it
252-
r'(?:\s+"[^"]*")?' # optional "title" (ignored; build_md sets title=alt if non-empty)
253-
r'\s*\)',
254-
re.I
245+
r'!\[([^\]]*)\]' # group 1: alt
246+
r'\('
247+
r'\s*<?'
248+
r'([^)\r\n]+?)' # group 2: raw URL (no backref, we’ll clean it)
249+
r'>?' # allow a dangling '>' but don't capture it
250+
r'(?:\s+"[^"]*")?' # optional "title" (ignored; build_md sets title=alt if non-empty)
251+
r'\s*\)',
252+
re.I
255253
)
256254
s = md_img_any.sub(lambda m: build_md(m.group(1), m.group(2)), s)
255+
256+
# s = replace_all_bold(s)
257+
257258
258259
# 3) Gather reference defs
259260
defs = {}

0 commit comments

Comments
 (0)