From a6679c1acd827598dbcf9e0f3776a6b4dd94227b Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Fri, 10 Apr 2026 08:36:33 +0100 Subject: [PATCH 1/2] brackets fix --- webtools/markup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webtools/markup.py b/webtools/markup.py index a4ef822..f8a80bc 100644 --- a/webtools/markup.py +++ b/webtools/markup.py @@ -316,15 +316,15 @@ def insert_links(txt: str, root_dir: str = "") -> str: Returns: Text with links """ - txt = re.sub(r"\(\/([^\)]+)\.md\)", r"(\1.html)", txt) - txt = re.sub(r"\(\/([^\)]+)\.md#([^\)]+)\)", r"(\1.html#\2)", txt) + txt = re.sub(r"\(\/([^\(\)]+)\.md\)", r"(\1.html)", txt) + txt = re.sub(r"\(\/([^\(\)]+)\.md#([^\)]+)\)", r"(\1.html#\2)", txt) if root_dir == "": - txt = re.sub(r"\(([^\)]+)\.md\)", r"(/\1.html)", txt) - txt = re.sub(r"\(([^\)]+)\.md#([^\)]+)\)", r"(/\1.html#\2)", txt) + txt = re.sub(r"\(([^\(\)]+)\.md\)", r"(/\1.html)", txt) + txt = re.sub(r"\(([^\(\)]+)\.md#([^\)]+)\)", r"(/\1.html#\2)", txt) else: - txt = re.sub(r"\(([^\)]+)\.md\)", rf"(/{root_dir}/\1.html)", txt) - txt = re.sub(r"\(([^\)]+)\.md#([^\)]+)\)", rf"(/{root_dir}/\1.html#\2)", txt) - txt = re.sub(r"\[([^\]]+)\]\(([^\)]+)\)", r"\1", txt) + txt = re.sub(r"\(([^\(\)]+)\.md\)", rf"(/{root_dir}/\1.html)", txt) + txt = re.sub(r"\(([^\(\)]+)\.md#([^\)]+)\)", rf"(/{root_dir}/\1.html#\2)", txt) + txt = re.sub(r"\[([^\[\]]+)\]\(([^\(\)]+)\)", r"\1", txt) return txt From ca9bdcde438918d153d6c953b8c53c3fd35c1257 Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Fri, 10 Apr 2026 08:36:58 +0100 Subject: [PATCH 2/2] version++ --- pyproject.toml | 2 +- webtools/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index db4a726..92c6411 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "website-build-tools" -version = "0.1.13" +version = "0.1.14" description = "tools for building websites, used by defelement.org and quadraturerules.org" readme = "README.md" requires-python = ">=3.10.0" diff --git a/webtools/__init__.py b/webtools/__init__.py index f578004..7fec3b7 100644 --- a/webtools/__init__.py +++ b/webtools/__init__.py @@ -1,3 +1,3 @@ """Website building tools.""" -__version__ = "0.1.13" +__version__ = "0.1.14"