plugin updates

This commit is contained in:
Tony Volpe
2024-11-25 13:10:11 -05:00
parent 864fe717f9
commit 76d447655a
48 changed files with 1945 additions and 200 deletions

View File

@@ -1157,6 +1157,33 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
$token_type = $this->get_token_type();
switch ( $token_type ) {
case '#doctype':
$doctype = $this->get_doctype_info();
if ( null === $doctype ) {
break;
}
$html .= '<!DOCTYPE';
if ( $doctype->name ) {
$html .= " {$doctype->name}";
}
if ( null !== $doctype->public_identifier ) {
$quote = str_contains( $doctype->public_identifier, '"' ) ? "'" : '"';
$html .= " PUBLIC {$quote}{$doctype->public_identifier}{$quote}";
}
if ( null !== $doctype->system_identifier ) {
if ( null === $doctype->public_identifier ) {
$html .= ' SYSTEM';
}
$quote = str_contains( $doctype->system_identifier, '"' ) ? "'" : '"';
$html .= " {$quote}{$doctype->system_identifier}{$quote}";
}
$html .= '>';
break;
case '#text':
$html .= htmlspecialchars( $this->get_modifiable_text(), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8' );
break;
@@ -1173,10 +1200,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
case '#cdata-section':
$html .= "<![CDATA[{$this->get_modifiable_text()}]]>";
break;
case 'html':
$html .= '<!DOCTYPE html>';
break;
}
if ( '#tag' !== $token_type ) {