@@ -500,134 +500,134 @@ |
||
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 == 'tr' |
|
517 | + $tag_name == 'tr' |
|
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 | $nextSibling->tagName == 'tr' |
526 | - ) |
|
527 | - ) |
|
528 | - ) |
|
526 | + ) |
|
527 | + ) |
|
528 | + ) |
|
529 | 529 | || |
530 | 530 | ( |
531 | - $tag_name == 'td' |
|
531 | + $tag_name == 'td' |
|
532 | 532 | && |
533 | 533 | ( |
534 | - $nextSibling === null |
|
534 | + $nextSibling === null |
|
535 | 535 | || |
536 | 536 | ( |
537 | - $nextSibling instanceof \DOMElement |
|
537 | + $nextSibling instanceof \DOMElement |
|
538 | 538 | && |
539 | 539 | ( |
540 | - $nextSibling->tagName == 'td' |
|
540 | + $nextSibling->tagName == 'td' |
|
541 | 541 | || |
542 | 542 | $nextSibling->tagName == 'th' |
543 | - ) |
|
544 | - ) |
|
545 | - ) |
|
546 | - ) |
|
543 | + ) |
|
544 | + ) |
|
545 | + ) |
|
546 | + ) |
|
547 | 547 | || |
548 | 548 | ( |
549 | - $tag_name == 'option' |
|
549 | + $tag_name == 'option' |
|
550 | 550 | && |
551 | 551 | ( |
552 | - $nextSibling === null |
|
552 | + $nextSibling === null |
|
553 | 553 | || |
554 | 554 | ( |
555 | - $nextSibling instanceof \DOMElement |
|
555 | + $nextSibling instanceof \DOMElement |
|
556 | 556 | && |
557 | 557 | ( |
558 | - $nextSibling->tagName == 'option' |
|
558 | + $nextSibling->tagName == 'option' |
|
559 | 559 | || |
560 | 560 | $nextSibling->tagName == 'optgroup' |
561 | - ) |
|
562 | - ) |
|
563 | - ) |
|
564 | - ) |
|
561 | + ) |
|
562 | + ) |
|
563 | + ) |
|
564 | + ) |
|
565 | 565 | || |
566 | 566 | ( |
567 | - $tag_name == 'p' |
|
567 | + $tag_name == 'p' |
|
568 | 568 | && |
569 | 569 | ( |
570 | - ( |
|
571 | - $nextSibling === null |
|
570 | + ( |
|
571 | + $nextSibling === null |
|
572 | 572 | && |
573 | 573 | ( |
574 | - $node->parentNode !== null |
|
574 | + $node->parentNode !== null |
|
575 | 575 | && |
576 | 576 | !\in_array( |
577 | - $node->parentNode->tagName, |
|
578 | - [ |
|
579 | - 'a', |
|
580 | - 'audio', |
|
581 | - 'del', |
|
582 | - 'ins', |
|
583 | - 'map', |
|
584 | - 'noscript', |
|
585 | - 'video' |
|
586 | - ], |
|
587 | - true |
|
588 | - ) |
|
589 | - ) |
|
590 | - ) |
|
577 | + $node->parentNode->tagName, |
|
578 | + [ |
|
579 | + 'a', |
|
580 | + 'audio', |
|
581 | + 'del', |
|
582 | + 'ins', |
|
583 | + 'map', |
|
584 | + 'noscript', |
|
585 | + 'video' |
|
586 | + ], |
|
587 | + true |
|
588 | + ) |
|
589 | + ) |
|
590 | + ) |
|
591 | 591 | || |
592 | 592 | ( |
593 | - $nextSibling instanceof \DOMElement |
|
593 | + $nextSibling instanceof \DOMElement |
|
594 | 594 | && |
595 | 595 | \in_array( |
596 | - $nextSibling->tagName, |
|
597 | - [ |
|
598 | - 'address', |
|
599 | - 'article', |
|
600 | - 'aside', |
|
601 | - 'blockquote', |
|
602 | - 'dir', |
|
603 | - 'div', |
|
604 | - 'dl', |
|
605 | - 'fieldset', |
|
606 | - 'footer', |
|
607 | - 'form', |
|
608 | - 'h1', |
|
609 | - 'h2', |
|
610 | - 'h3', |
|
611 | - 'h4', |
|
612 | - 'h5', |
|
613 | - 'h6', |
|
614 | - 'header', |
|
615 | - 'hgroup', |
|
616 | - 'hr', |
|
617 | - 'menu', |
|
618 | - 'nav', |
|
619 | - 'ol', |
|
620 | - 'p', |
|
621 | - 'pre', |
|
622 | - 'section', |
|
623 | - 'table', |
|
624 | - 'ul', |
|
625 | - ], |
|
626 | - true |
|
627 | - ) |
|
628 | - ) |
|
629 | - ) |
|
630 | - ); |
|
596 | + $nextSibling->tagName, |
|
597 | + [ |
|
598 | + 'address', |
|
599 | + 'article', |
|
600 | + 'aside', |
|
601 | + 'blockquote', |
|
602 | + 'dir', |
|
603 | + 'div', |
|
604 | + 'dl', |
|
605 | + 'fieldset', |
|
606 | + 'footer', |
|
607 | + 'form', |
|
608 | + 'h1', |
|
609 | + 'h2', |
|
610 | + 'h3', |
|
611 | + 'h4', |
|
612 | + 'h5', |
|
613 | + 'h6', |
|
614 | + 'header', |
|
615 | + 'hgroup', |
|
616 | + 'hr', |
|
617 | + 'menu', |
|
618 | + 'nav', |
|
619 | + 'ol', |
|
620 | + 'p', |
|
621 | + 'pre', |
|
622 | + 'section', |
|
623 | + 'table', |
|
624 | + 'ul', |
|
625 | + ], |
|
626 | + true |
|
627 | + ) |
|
628 | + ) |
|
629 | + ) |
|
630 | + ); |
|
631 | 631 | } |
632 | 632 | |
633 | 633 | protected function domNodeToString(\DOMNode $node): string |