Skip to content

Commit 49839cb

Browse files
committed
Attempt to use the correct quotes when rebuilding HTML.
1 parent 7001386 commit 49839cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

php/class-delivery.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,12 @@ public function rebuild_tag( $tag_element ) {
13761376
// Setup new tag.
13771377
$replace = HTML::build_tag( $tag_element['tag'], $tag_element['atts'] );
13781378

1379+
// If the original tag used single quotes, we need to use them in the new tag.
1380+
$single_quotes = (bool) preg_match( '/=\s*\'/', $tag_element['original'] );
1381+
if ( $single_quotes ) {
1382+
$replace = str_replace( '"', "'", $replace );
1383+
}
1384+
13791385
/**
13801386
* Filter the new built tag element.
13811387
*

0 commit comments

Comments
 (0)