Skip to content

Commit

Permalink
Move HTML rewriting rules to standalone functions
Browse files Browse the repository at this point in the history
Create HTMLRewritingRules object supporting various rewrite operations:
- drop attribute
- rewrite attribute
- rewrite whole tag
- rewrite data

Each operation is supported by a decorator which can be used on any
function defining a rewrite operation.

This commit also moves all existing rewriting operations to standalone
functions.
  • Loading branch information
benoit74 committed Jul 30, 2024
1 parent deb7df6 commit 681a7f7
Show file tree
Hide file tree
Showing 4 changed files with 994 additions and 140 deletions.
3 changes: 0 additions & 3 deletions src/warc2zim/content_rewriting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from collections.abc import Callable

UrlRewriterProto = Callable[[str], str]
Loading

0 comments on commit 681a7f7

Please sign in to comment.