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

Update Html.php to enable choice of leading method. #2379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

macrini
Copy link

@macrini macrini commented Feb 8, 2023

The current loadXML() rejects valid self-closing elements from HTML. The problem can be fixed in a backwards compatible way by adding a new boolean argument to choose which loading method to use.

Description

Self-closing tags like <br> and <img> are valid in HTML but not in XML. Loading the DOM via loadHTML() solves the current problem with the static function addHtml(). Since the loading method is a choice that depends on the caller, a new boolean argument is added to control which method will be used, defaulting to the current behaviour which is to use loadXML().

Fixes # (issue)

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

The current loadXML() rejects valid self-closing elements from HTML. The problem can be fixed in a backwards compatible way by adding a new boolean argument to choose which loading method to use.
@Progi1984 Progi1984 force-pushed the master branch 3 times, most recently from 2d9f999 to e458249 Compare August 30, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant