Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge errors of #178 #184

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading