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: Add normalization functions. #7331

Closed
wants to merge 22 commits into from

Commits on Sep 11, 2024

  1. HTML API: Add normalization functions.

    The HTML Processor understands HTML regardless of how it's written, but
    many other functions are unable to do so. There are all sorts of syntax
    peculiarities and semantics that would be helpful to eliminate using the
    knowledge contained in the HTML Processor.
    
    This patch introduces `WP_HTML_Processor::normalize( $html )` as a
    method which takes a fragment of HTML as input and then returns a
    serialized version of the input, "cleaning it up" by balancing all
    tags, providing all missing optional tags, re-encoding all text,
    removing all duplicate attributes, and double-quote-escaping all
    attribute values.
    
    Core-62036
    dmsnell committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    d372c97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07e89bb View commit details
    Browse the repository at this point in the history
  3. Adjust some text encoding.

    dmsnell committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    754118e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9c6e34c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7f5783e View commit details
    Browse the repository at this point in the history
  6. Progressive tense for function summaries.

    Co-authored-by: Weston Ruter <westonruter@git.wordpress.org>
    dmsnell and westonruter committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    2aa89fa View commit details
    Browse the repository at this point in the history
  7. Leave space before self-closing flag to avoid later problems.

    If code later in the processing pipeline adds unquoted attributes
    and doesn't add the requisite space following that, then another
    parser might find that the solidus is part of the attribute value
    instead of serving as a self-closing flag.
    
    Co-authored-by: Weston Ruter <westonruter@git.wordpress.org>
    dmsnell and westonruter committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    7029b25 View commit details
    Browse the repository at this point in the history
  8. Expand support for bogus comments.

    Co-authored-by: Weston Ruter <westonruter@git.wordpress.org>
    dmsnell and westonruter committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    00a5773 View commit details
    Browse the repository at this point in the history
  9. Whitespace

    dmsnell committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    99799b7 View commit details
    Browse the repository at this point in the history
  10. Update docs examples.

    dmsnell committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    db24c11 View commit details
    Browse the repository at this point in the history
  11. Raise WP error when failing.

    Co-authored-by: Weston Ruter <westonruter@git.wordpress.org>
    dmsnell and westonruter committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    7b8aa53 View commit details
    Browse the repository at this point in the history
  12. Change error level to warning.

    Co-authored-by: Weston Ruter <westonruter@git.wordpress.org>
    dmsnell and westonruter committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    18b5005 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. Configuration menu
    Copy the full SHA
    47f7f08 View commit details
    Browse the repository at this point in the history
  2. Add basic unit test suite.

    dmsnell committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    92558b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6167887 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    95756e5 View commit details
    Browse the repository at this point in the history
  5. Make the kwality 110% butter

    dmsnell committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    fca6481 View commit details
    Browse the repository at this point in the history
  6. Fix wrong test setup.

    dmsnell committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    b37b312 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dd4ff16 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    588020f View commit details
    Browse the repository at this point in the history
  9. Fix text alignment in docs.

    dmsnell committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    0abf367 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    37b7fe8 View commit details
    Browse the repository at this point in the history