From 89ea18a805331ef41043ff1ed03e1c79c3b1345a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 11 Apr 2024 01:24:34 +0200 Subject: [PATCH] Allow parentheses in post headers values --- madblog/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/madblog/app.py b/madblog/app.py index 066a396..db3ca4a 100644 --- a/madblog/app.py +++ b/madblog/app.py @@ -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":