Skip to content

Commit

Permalink
Merge pull request #184 from openzim/fix_main
Browse files Browse the repository at this point in the history
Fix merge errors of #178
  • Loading branch information
benoit74 authored Jul 30, 2024
2 parents fff2c10 + 9126fa9 commit d647913
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/zimscraperlib/zim/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d647913

Please sign in to comment.