Skip to content

Commit 245b7ec

Browse files
Update process_notebooks.py
1 parent 0b4c665 commit 245b7ec

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

website/process_notebooks.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ def convert_callout_blocks(content: str) -> str:
378378
#
379379
# ^(?P<backticks>`{3,4})(?:mdx-code-block|\{=mdx\})[ \t]*\n
380380
# - Matches opening backticks and optional mdx markers.
381-
# :::(?P<callout_type_backtick>...)
381+
# :::(?P<callout_type_backtick>...)
382382
# - Captures the callout type.
383-
# (.*?)
383+
# (.*?)
384384
# - Captures the content inside the callout.
385385
# ^:::[ \t]*\n
386386
# - Matches the closing ::: line.
@@ -408,7 +408,7 @@ def convert_callout_blocks(content: str) -> str:
408408
r":::(?P<callout_type_backtick>\w+(?:\s+\w+)?)[ \t]*\n"
409409
r"(?P<inner_backtick>.*?)"
410410
r"^:::[ \t]*\n"
411-
r"(?P=backticks)" # Closing backticks must match the opening count.
411+
r"(?P=backticks)" # Closing backticks must match the opening count.
412412
r")"
413413
r"|"
414414
# Alternative #2: Plain ::: callout
@@ -421,12 +421,12 @@ def convert_callout_blocks(content: str) -> str:
421421

422422
def replace_callout(m: re.Match) -> str:
423423
# Determine the matched alternative and extract the corresponding groups.
424-
ctype = m.group('callout_type_backtick') or m.group('callout_type_no_backtick')
425-
inner = m.group('inner_backtick') or m.group('inner_no_backtick') or ""
424+
ctype = m.group("callout_type_backtick") or m.group("callout_type_no_backtick")
425+
inner = m.group("inner_backtick") or m.group("inner_no_backtick") or ""
426426

427427
# Map the callout type to its standard representation or fallback to the original type.
428428
mapped_type = callout_types.get(ctype, ctype)
429-
429+
430430
# Return the formatted HTML block.
431431
return f"""
432432
<div class="{ctype}">
@@ -440,7 +440,6 @@ def replace_callout(m: re.Match) -> str:
440440
return pattern.sub(replace_callout, content)
441441

442442

443-
444443
def convert_mdx_image_blocks(content: str, rendered_mdx: Path, website_dir: Path) -> str:
445444
"""
446445
Converts MDX code block image syntax to regular markdown image syntax.

0 commit comments

Comments
 (0)