From 9126fa9f0aae099f2e99e1f824d9a17575f17bba Mon Sep 17 00:00:00 2001 From: benoit74 Date: Tue, 30 Jul 2024 09:35:22 +0000 Subject: [PATCH] Fix merge errors of #178 --- src/zimscraperlib/zim/creator.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/zimscraperlib/zim/creator.py b/src/zimscraperlib/zim/creator.py index 408a19dd..a633b7b1 100644 --- a/src/zimscraperlib/zim/creator.py +++ b/src/zimscraperlib/zim/creator.py @@ -286,10 +286,8 @@ def add_metadata( mimetype: str = "text/plain;charset=UTF-8", ): # drop control characters before passing them to libzim - if isinstance(content, str): - content = UNWANTED_CONTROL_CHARACTERS_REGEX.sub("", content).strip( - " \r\n\t" - ) + if isinstance(value, str): + value = UNWANTED_CONTROL_CHARACTERS_REGEX.sub("", value).strip(" \r\n\t") if not self.disable_metadata_checks: self.validate_metadata(name, value) @@ -387,7 +385,6 @@ def add_item_for( duplicate_ok: bool | None = None, callback: Callable | tuple[Callable, Any] | None = None, index_data: IndexData | None = None, - *, auto_index: bool = True, ): """Add a File or content at a specified path and get its path