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

(html_render_diff) Changes should break around <label> elements #201

Open
Mr0grog opened this issue Mar 7, 2025 · 1 comment
Open

(html_render_diff) Changes should break around <label> elements #201

Mr0grog opened this issue Mar 7, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Mr0grog
Copy link
Member

Mr0grog commented Mar 7, 2025

We currently break change elements (<ins>, <del>) around block-level elements and <a> elements so that they are always children or siblings of those elements rather than wrapping them:

# Also treat `a` tags as block in this context, because they *can*
# contain block elements, like `h1`, etc.
is_block = name in block_level_tags or name == 'a'

# Also treat `a` tags as block in this context, because they *can*
# contain block elements, like `h1`, etc.
is_block = name in block_level_tags or name == 'a'

We should also include <label> here, since it is frequently presented as block level, even though it is not by default. For example, this change within a label looks confusing because we don’t do this (the text “School or school district” was inserted at the start of the “ZIP Code” label, but the current presentation looks like there is a weird, spurious “School or school district” label getting repeated on the page):

Screenshot of the above diff

@Mr0grog Mr0grog added the enhancement New feature or request label Mar 7, 2025
@Mr0grog Mr0grog moved this from Inbox to Prioritized in Web Monitoring Mar 7, 2025
@Mr0grog
Copy link
Member Author

Mr0grog commented Mar 7, 2025

We should also unify and abstract this idea of checking whether an element should break or be broken by change element. Having this code repeated is bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Prioritized
Development

No branches or pull requests

1 participant