Skip to content

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

Open
@Mr0grog

Description

@Mr0grog

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Prioritized

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions