Skip to content

Commit 25341a0

Browse files
authored
Update for corrected indicated_compatibility_mode doctype property (#7)
See WordPress/wordpress-develop#9401.
1 parent 0415a71 commit 25341a0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

html-api-debugger/html-api-integration.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ function get_tree( string $html, array $options ): array {
129129
$doctype_name = $doctype->name;
130130
$doctype_public_identifier = $doctype->public_identifier;
131131
$doctype_system_identifier = $doctype->system_identifier;
132-
if ( $doctype->indicated_compatability_mode !== 'quirks' ) {
132+
if (
133+
( property_exists( $doctype, 'indicated_compatibility_mode' )
134+
? $doctype->indicated_compatibility_mode
135+
: $doctype->indicated_compatability_mode ) !== 'quirks'
136+
) {
133137
$compat_mode = 'CSS1Compat';
134138
}
135139
break;
@@ -234,7 +238,11 @@ function get_tree( string $html, array $options ): array {
234238
$doctype_name = $doctype->name;
235239
$doctype_public_identifier = $doctype->public_identifier;
236240
$doctype_system_identifier = $doctype->system_identifier;
237-
if ( $doctype->indicated_compatability_mode !== 'quirks' ) {
241+
if (
242+
( property_exists( $doctype, 'indicated_compatibility_mode' )
243+
? $doctype->indicated_compatibility_mode
244+
: $doctype->indicated_compatability_mode ) !== 'quirks'
245+
) {
238246
$compat_mode = 'CSS1Compat';
239247
}
240248

html-api-debugger/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Please file issues and pull requests on the [GitHub repository](https://github.c
1717

1818
= 2.8 =
1919
* Silence _doing_it_wrong bookmark notices when providing from HTML context.
20+
* Adjust doctype info to account for typo fix.
2021

2122
= 2.7 =
2223
* Preserve attribute value line breaks in tree views.

0 commit comments

Comments
 (0)