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

Enhance maintainability and accuracy of HTML rewriting rules #305

Open
benoit74 opened this issue Jun 11, 2024 · 0 comments · May be fixed by #343
Open

Enhance maintainability and accuracy of HTML rewriting rules #305

benoit74 opened this issue Jun 11, 2024 · 0 comments · May be fixed by #343
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@benoit74
Copy link
Collaborator

Currently, when we rewrite HTML tags:

  • logic is hard to read because it is dispersed between the logic handling the tag and the logic handling the attributes themselves
  • logic is not totally accurate because we do not take into account the whole tree hierarchy (e.g. we rewrite meta tags no matter where they are, while we should do it only in html->head->meta) ; this is not a huge concern because usually when tag should be rewritten at only one position of the tree, then it is not valid from an HTML perspective to find it somewhere else ; however it does not help to read
  • logic is not open to extension of new rules: adding new rules involves precise tweaking of various parts of the code where one would prefer to just declare a new rule with its logic somewhere (probably in a class)
  • logic is not really easy to test: in order to test the rules, we need to setup the whole HTML document and the whole rewriter, including the set of known ZIM items, ... even if we do not care about them
@benoit74 benoit74 added the enhancement New feature or request label Jun 11, 2024
@benoit74 benoit74 added this to the 2.1.0 milestone Jun 11, 2024
@benoit74 benoit74 self-assigned this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
1 participant