@@ -500,102 +500,102 @@ |
||
500 | 500 | return \in_array($tag_name, self::$optional_end_tags, true) |
501 | 501 | || |
502 | 502 | ( |
503 | - $tag_name == 'li' |
|
503 | + $tag_name == 'li' |
|
504 | 504 | && |
505 | 505 | ( |
506 | - $nextSibling === null |
|
506 | + $nextSibling === null |
|
507 | 507 | || |
508 | 508 | ( |
509 | - $nextSibling instanceof \DOMElement |
|
509 | + $nextSibling instanceof \DOMElement |
|
510 | 510 | && |
511 | 511 | $nextSibling->tagName == 'li' |
512 | - ) |
|
513 | - ) |
|
514 | - ) |
|
512 | + ) |
|
513 | + ) |
|
514 | + ) |
|
515 | 515 | || |
516 | 516 | ( |
517 | - $tag_name == 'td' |
|
517 | + $tag_name == 'td' |
|
518 | 518 | && |
519 | 519 | ( |
520 | - $nextSibling === null |
|
520 | + $nextSibling === null |
|
521 | 521 | || |
522 | 522 | ( |
523 | - $nextSibling instanceof \DOMElement |
|
523 | + $nextSibling instanceof \DOMElement |
|
524 | 524 | && |
525 | 525 | ( |
526 | - $nextSibling->tagName == 'td' |
|
526 | + $nextSibling->tagName == 'td' |
|
527 | 527 | || |
528 | 528 | $nextSibling->tagName == 'th' |
529 | - ) |
|
530 | - ) |
|
531 | - ) |
|
532 | - ) |
|
529 | + ) |
|
530 | + ) |
|
531 | + ) |
|
532 | + ) |
|
533 | 533 | || |
534 | 534 | ( |
535 | - $tag_name == 'p' |
|
535 | + $tag_name == 'p' |
|
536 | 536 | && |
537 | 537 | ( |
538 | - ( |
|
539 | - $nextSibling === null |
|
538 | + ( |
|
539 | + $nextSibling === null |
|
540 | 540 | && |
541 | 541 | ( |
542 | - $node->parentNode !== null |
|
542 | + $node->parentNode !== null |
|
543 | 543 | && |
544 | 544 | !\in_array( |
545 | - $node->parentNode->tagName, |
|
546 | - [ |
|
547 | - 'a', |
|
548 | - 'audio', |
|
549 | - 'del', |
|
550 | - 'ins', |
|
551 | - 'map', |
|
552 | - 'noscript', |
|
553 | - 'video' |
|
554 | - ], |
|
555 | - true |
|
556 | - ) |
|
557 | - ) |
|
558 | - ) |
|
545 | + $node->parentNode->tagName, |
|
546 | + [ |
|
547 | + 'a', |
|
548 | + 'audio', |
|
549 | + 'del', |
|
550 | + 'ins', |
|
551 | + 'map', |
|
552 | + 'noscript', |
|
553 | + 'video' |
|
554 | + ], |
|
555 | + true |
|
556 | + ) |
|
557 | + ) |
|
558 | + ) |
|
559 | 559 | || |
560 | 560 | ( |
561 | - $nextSibling instanceof \DOMElement |
|
561 | + $nextSibling instanceof \DOMElement |
|
562 | 562 | && |
563 | 563 | \in_array( |
564 | - $nextSibling->tagName, |
|
565 | - [ |
|
566 | - 'address', |
|
567 | - 'article', |
|
568 | - 'aside', |
|
569 | - 'blockquote', |
|
570 | - 'dir', |
|
571 | - 'div', |
|
572 | - 'dl', |
|
573 | - 'fieldset', |
|
574 | - 'footer', |
|
575 | - 'form', |
|
576 | - 'h1', |
|
577 | - 'h2', |
|
578 | - 'h3', |
|
579 | - 'h4', |
|
580 | - 'h5', |
|
581 | - 'h6', |
|
582 | - 'header', |
|
583 | - 'hgroup', |
|
584 | - 'hr', |
|
585 | - 'menu', |
|
586 | - 'nav', |
|
587 | - 'ol', |
|
588 | - 'p', |
|
589 | - 'pre', |
|
590 | - 'section', |
|
591 | - 'table', |
|
592 | - 'ul', |
|
593 | - ], |
|
594 | - true |
|
595 | - ) |
|
596 | - ) |
|
597 | - ) |
|
598 | - ); |
|
564 | + $nextSibling->tagName, |
|
565 | + [ |
|
566 | + 'address', |
|
567 | + 'article', |
|
568 | + 'aside', |
|
569 | + 'blockquote', |
|
570 | + 'dir', |
|
571 | + 'div', |
|
572 | + 'dl', |
|
573 | + 'fieldset', |
|
574 | + 'footer', |
|
575 | + 'form', |
|
576 | + 'h1', |
|
577 | + 'h2', |
|
578 | + 'h3', |
|
579 | + 'h4', |
|
580 | + 'h5', |
|
581 | + 'h6', |
|
582 | + 'header', |
|
583 | + 'hgroup', |
|
584 | + 'hr', |
|
585 | + 'menu', |
|
586 | + 'nav', |
|
587 | + 'ol', |
|
588 | + 'p', |
|
589 | + 'pre', |
|
590 | + 'section', |
|
591 | + 'table', |
|
592 | + 'ul', |
|
593 | + ], |
|
594 | + true |
|
595 | + ) |
|
596 | + ) |
|
597 | + ) |
|
598 | + ); |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | protected function domNodeToString(\DOMNode $node): string |