Allow parentheses in post headers values

This commit is contained in:
Fabio Manganiello 2024-04-11 01:24:34 +02:00
parent e3b30e6a98
commit 89ea18a805

View file

@ -61,11 +61,11 @@ class BlogApp(Flask):
with open(md_file, "r") as f:
metadata["uri"] = "/article/" + page[:-3]
for line in f.readlines():
for line in f:
if not line:
continue
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*([^)]+)\)\s*$", line)):
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*(.*)\)\s*$", line)):
break
if m.group(1) == "published":