Skip to content

Commit 479c0b3

Browse files
committed
Update comments, remove "only <body> context" mentions
1 parent 48e4738 commit 479c0b3

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,15 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
279279
* form is provided because a context element may have attributes that
280280
* impact the parse, such as with a SCRIPT tag and its `type` attribute.
281281
*
282-
* ## Current HTML Support
283-
*
284-
* - The only supported context is `<body>`, which is the default value.
285-
* - The only supported document encoding is `UTF-8`, which is the default value.
282+
* UTF-8 is the only allowed encoding. If working with a document that
283+
* isn't UTF-8, first convert the document to UTF-8, then pass in the
284+
* converted HTML.
286285
*
287286
* @since 6.4.0
288287
* @since 6.6.0 Returns `static` instead of `self` so it can create subclass instances.
289288
*
290289
* @param string $html Input HTML fragment to process.
291-
* @param string $context Context element for the fragment, must be default of `<body>`.
290+
* @param string $context Context element for the fragment. Defaults to `<body>`.
292291
* @param string $encoding Text encoding of the document; must be default of 'UTF-8'.
293292
* @return static|null The created processor if successful, otherwise null.
294293
*/
@@ -320,9 +319,9 @@ public static function create_fragment( $html, $context = '<body>', $encoding =
320319
* entire HTML document from start to finish. Consider a fragment parser with
321320
* a context node of `<body>`.
322321
*
323-
* Since UTF-8 is the only currently-accepted charset, if working with a
324-
* document that isn't UTF-8, it's important to convert the document before
325-
* creating the processor: pass in the converted HTML.
322+
* UTF-8 is the only allowed encoding. If working with a document that
323+
* isn't UTF-8, first convert the document to UTF-8, then pass in the
324+
* converted HTML.
326325
*
327326
* @param string $html Input HTML document to process.
328327
* @param string|null $known_definite_encoding Optional. If provided, specifies the charset used

0 commit comments

Comments
 (0)