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 API: Replace internal logic of force_balance_tags() #7409

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Commits on Sep 21, 2024

  1. HTML API: Replace internal logic of force_balance_tags()

    The concept of `force_balance_tags()` is tricky at best. It's purpose,
    however is clear: clean up HTML input no matter how "bad" it appears.
    
    The HTML API introduces a new tool based on a systematic approach to
    normalizing by serializing. `WP_HTML_Processor::normalize()` produces
    clear and consistent output HTML regardless of the input and without any
    special-casing for "edge cases." As a spec-compliant parser, everything
    is a basic case of applying the parsing rules.
    
    Since there are still documents that the HTML API cannot parse, this is
    an optimistic refactor. For the cases of unsupported HTML, the behavior
    falls back to the legacy code. When the HTML API finished supporting all
    content it may be possible to eliminate the legacy code, but until then,
    most inputs will be handled by the HTML API.
    dmsnell committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    e631f42 View commit details
    Browse the repository at this point in the history