Changeset 58740
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r58613 r58740 2219 2219 * in the output HTML but produce a noisier change. 2220 2220 */ 2221 $class .= substr( $existing_class, $ws_at, $ws_length ); 2221 if ( '' !== $class ) { 2222 $class .= substr( $existing_class, $ws_at, $ws_length ); 2223 } 2222 2224 $class .= $name; 2223 2225 } -
trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r58233 r58740 1377 1377 1378 1378 $this->assertSame( 1379 '<div class=" with-border" id="first"><span class="not-main bold with-border" id="second">Text</span></div>',1379 '<div class="with-border" id="first"><span class="not-main bold with-border" id="second">Text</span></div>', 1380 1380 $processor->get_updated_html(), 1381 1381 'Updated HTML does not reflect class name removed from existing class attribute via remove_class()' 1382 1382 ); 1383 1383 $this->assertSame( 1384 ' with-border',1384 'with-border', 1385 1385 $processor->get_attribute( 'class' ), 1386 1386 "get_attribute( 'class' ) does not reflect class name removed from existing class attribute via remove_class()" … … 1467 1467 1468 1468 $this->assertSame( 1469 '<div class=" main with-border foo-class" id="first"><span class="not-main bold with-border" id="second">Text</span></div>',1469 '<div class="main with-border foo-class" id="first"><span class="not-main bold with-border" id="second">Text</span></div>', 1470 1470 $processor->get_updated_html(), 1471 1471 'Updated HTML does not reflect existing excessive whitespace after adding class name via add_class()' 1472 1472 ); 1473 1473 $this->assertSame( 1474 ' main with-border foo-class',1474 'main with-border foo-class', 1475 1475 $processor->get_attribute( 'class' ), 1476 1476 "get_attribute( 'class' ) does not reflect existing excessive whitespace after adding class name via add_class()" … … 1491 1491 1492 1492 $this->assertSame( 1493 '<div class=" main" id="first"><span class="not-main bold with-border" id="second">Text</span></div>',1493 '<div class="main" id="first"><span class="not-main bold with-border" id="second">Text</span></div>', 1494 1494 $processor->get_updated_html(), 1495 1495 'Updated HTML does not reflect existing excessive whitespace after removing class name via remove_class()' 1496 1496 ); 1497 1497 $this->assertSame( 1498 ' main',1498 'main', 1499 1499 $processor->get_attribute( 'class' ), 1500 1500 "get_attribute( 'class' ) does not reflect existing excessive whitespace after removing class name via removing_class()" … … 1697 1697 <div data-details="{ "key": "value" }" selected class="merge-message is-processed" checked> 1698 1698 <div class="select-menu d-inline-block"> 1699 <div checked class=" MixedCaseHTML position-relative button-group Another-Mixed-Case" />1700 <div checked class=" MixedCaseHTML position-relative button-group Another-Mixed-Case">1699 <div checked class="MixedCaseHTML position-relative button-group Another-Mixed-Case" /> 1700 <div checked class="MixedCaseHTML position-relative button-group Another-Mixed-Case"> 1701 1701 <button type="button" class="merge-box-button btn-group-merge rounded-left-2 btn BtnGroup-item js-details-target hx_create-pr-button" aria-expanded="false" data-details-container=".js-merge-pr" disabled=""> 1702 1702 Merge pull request
Note: See TracChangeset
for help on using the changeset viewer.