Skip to content

Commit d647913

Browse files
authored
Merge pull request #184 from openzim/fix_main
Fix merge errors of #178
2 parents fff2c10 + 9126fa9 commit d647913

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/zimscraperlib/zim/creator.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,8 @@ def add_metadata(
286286
mimetype: str = "text/plain;charset=UTF-8",
287287
):
288288
# drop control characters before passing them to libzim
289-
if isinstance(content, str):
290-
content = UNWANTED_CONTROL_CHARACTERS_REGEX.sub("", content).strip(
291-
" \r\n\t"
292-
)
289+
if isinstance(value, str):
290+
value = UNWANTED_CONTROL_CHARACTERS_REGEX.sub("", value).strip(" \r\n\t")
293291
if not self.disable_metadata_checks:
294292
self.validate_metadata(name, value)
295293

@@ -387,7 +385,6 @@ def add_item_for(
387385
duplicate_ok: bool | None = None,
388386
callback: Callable | tuple[Callable, Any] | None = None,
389387
index_data: IndexData | None = None,
390-
*,
391388
auto_index: bool = True,
392389
):
393390
"""Add a File or content at a specified path and get its path

0 commit comments

Comments
 (0)