From 9b13ee0b3a6d40927a54aa4fc391ea5777248692 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Mon, 16 Sep 2024 03:23:23 +0000 Subject: [PATCH] fix: Handle extraction patterns that return None (#26) Reviewed-on: https://code.studioinfinity.org/glen/mkdocs-semiliterate/pulls/26 Co-authored-by: Glen Whitney Co-committed-by: Glen Whitney --- mkdocs_semiliterate/plugin.py | 2 ++ setup.cfg | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mkdocs_semiliterate/plugin.py b/mkdocs_semiliterate/plugin.py index 6e368ad..255467c 100644 --- a/mkdocs_semiliterate/plugin.py +++ b/mkdocs_semiliterate/plugin.py @@ -156,6 +156,8 @@ is checked for `{! ... !}`. and handling inclusion syntax. """ line = extraction_pattern.replace_line(line) + if line is None: + return include_match = StreamInclusion.include_open.search(line) if not include_match: self.output_stream.write(line) diff --git a/setup.cfg b/setup.cfg index 07eb2b0..cbbe068 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = mkdocs-semiliterate -version = 0.8.0 +version = 0.8.1 description = Extension of mkdocs-simple-plugin adding easy content inclusion long_description = file: README.md long_description_content_type = text/markdown