@@ -551,184 +551,184 @@ discard block |
||
551 | 551 | return \in_array($tag_name, self::$optional_end_tags, true) |
552 | 552 | || |
553 | 553 | ( |
554 | - $tag_name == 'li' |
|
554 | + $tag_name == 'li' |
|
555 | 555 | && |
556 | 556 | ( |
557 | - $nextSibling === null |
|
557 | + $nextSibling === null |
|
558 | 558 | || |
559 | 559 | ( |
560 | - $nextSibling instanceof \DOMElement |
|
560 | + $nextSibling instanceof \DOMElement |
|
561 | 561 | && |
562 | 562 | $nextSibling->tagName == 'li' |
563 | - ) |
|
564 | - ) |
|
565 | - ) |
|
563 | + ) |
|
564 | + ) |
|
565 | + ) |
|
566 | 566 | || |
567 | 567 | ( |
568 | - ( |
|
569 | - $tag_name == 'rp' |
|
570 | - ) |
|
568 | + ( |
|
569 | + $tag_name == 'rp' |
|
570 | + ) |
|
571 | 571 | && |
572 | 572 | ( |
573 | - $nextSibling === null |
|
573 | + $nextSibling === null |
|
574 | 574 | || |
575 | 575 | ( |
576 | - $nextSibling instanceof \DOMElement |
|
576 | + $nextSibling instanceof \DOMElement |
|
577 | 577 | && |
578 | 578 | ( |
579 | - $nextSibling->tagName == 'rp' |
|
579 | + $nextSibling->tagName == 'rp' |
|
580 | 580 | || |
581 | 581 | $nextSibling->tagName == 'rt' |
582 | - ) |
|
583 | - ) |
|
584 | - ) |
|
585 | - ) |
|
582 | + ) |
|
583 | + ) |
|
584 | + ) |
|
585 | + ) |
|
586 | 586 | || |
587 | 587 | ( |
588 | - $tag_name == 'tr' |
|
588 | + $tag_name == 'tr' |
|
589 | 589 | && |
590 | 590 | ( |
591 | - $nextSibling === null |
|
591 | + $nextSibling === null |
|
592 | 592 | || |
593 | 593 | ( |
594 | - $nextSibling instanceof \DOMElement |
|
594 | + $nextSibling instanceof \DOMElement |
|
595 | 595 | && |
596 | 596 | $nextSibling->tagName == 'tr' |
597 | - ) |
|
598 | - ) |
|
599 | - ) |
|
597 | + ) |
|
598 | + ) |
|
599 | + ) |
|
600 | 600 | || |
601 | 601 | ( |
602 | - ( |
|
603 | - $tag_name == 'td' |
|
602 | + ( |
|
603 | + $tag_name == 'td' |
|
604 | 604 | || |
605 | 605 | $tag_name == 'th' |
606 | - ) |
|
606 | + ) |
|
607 | 607 | && |
608 | 608 | ( |
609 | - $nextSibling === null |
|
609 | + $nextSibling === null |
|
610 | 610 | || |
611 | 611 | ( |
612 | - $nextSibling instanceof \DOMElement |
|
612 | + $nextSibling instanceof \DOMElement |
|
613 | 613 | && |
614 | 614 | ( |
615 | - $nextSibling->tagName == 'td' |
|
615 | + $nextSibling->tagName == 'td' |
|
616 | 616 | || |
617 | 617 | $nextSibling->tagName == 'th' |
618 | - ) |
|
619 | - ) |
|
620 | - ) |
|
621 | - ) |
|
618 | + ) |
|
619 | + ) |
|
620 | + ) |
|
621 | + ) |
|
622 | 622 | || |
623 | 623 | ( |
624 | - ( |
|
625 | - $tag_name == 'dd' |
|
624 | + ( |
|
625 | + $tag_name == 'dd' |
|
626 | 626 | || |
627 | 627 | $tag_name == 'dt' |
628 | - ) |
|
628 | + ) |
|
629 | 629 | && |
630 | 630 | ( |
631 | - ( |
|
632 | - $nextSibling === null |
|
631 | + ( |
|
632 | + $nextSibling === null |
|
633 | 633 | && |
634 | 634 | $tag_name == 'dd' |
635 | - ) |
|
635 | + ) |
|
636 | 636 | || |
637 | 637 | ( |
638 | - $nextSibling instanceof \DOMElement |
|
638 | + $nextSibling instanceof \DOMElement |
|
639 | 639 | && |
640 | 640 | ( |
641 | - $nextSibling->tagName == 'dd' |
|
641 | + $nextSibling->tagName == 'dd' |
|
642 | 642 | || |
643 | 643 | $nextSibling->tagName == 'dt' |
644 | - ) |
|
645 | - ) |
|
646 | - ) |
|
647 | - ) |
|
644 | + ) |
|
645 | + ) |
|
646 | + ) |
|
647 | + ) |
|
648 | 648 | || |
649 | 649 | ( |
650 | - $tag_name == 'option' |
|
650 | + $tag_name == 'option' |
|
651 | 651 | && |
652 | 652 | ( |
653 | - $nextSibling === null |
|
653 | + $nextSibling === null |
|
654 | 654 | || |
655 | 655 | ( |
656 | - $nextSibling instanceof \DOMElement |
|
656 | + $nextSibling instanceof \DOMElement |
|
657 | 657 | && |
658 | 658 | ( |
659 | - $nextSibling->tagName == 'option' |
|
659 | + $nextSibling->tagName == 'option' |
|
660 | 660 | || |
661 | 661 | $nextSibling->tagName == 'optgroup' |
662 | - ) |
|
663 | - ) |
|
664 | - ) |
|
665 | - ) |
|
662 | + ) |
|
663 | + ) |
|
664 | + ) |
|
665 | + ) |
|
666 | 666 | || |
667 | 667 | ( |
668 | - $tag_name == 'p' |
|
668 | + $tag_name == 'p' |
|
669 | 669 | && |
670 | 670 | ( |
671 | - ( |
|
672 | - $nextSibling === null |
|
671 | + ( |
|
672 | + $nextSibling === null |
|
673 | 673 | && |
674 | 674 | ( |
675 | - $node->parentNode !== null |
|
675 | + $node->parentNode !== null |
|
676 | 676 | && |
677 | 677 | !\in_array( |
678 | - $node->parentNode->tagName, |
|
679 | - [ |
|
680 | - 'a', |
|
681 | - 'audio', |
|
682 | - 'del', |
|
683 | - 'ins', |
|
684 | - 'map', |
|
685 | - 'noscript', |
|
686 | - 'video', |
|
687 | - ], |
|
688 | - true |
|
689 | - ) |
|
690 | - ) |
|
691 | - ) |
|
678 | + $node->parentNode->tagName, |
|
679 | + [ |
|
680 | + 'a', |
|
681 | + 'audio', |
|
682 | + 'del', |
|
683 | + 'ins', |
|
684 | + 'map', |
|
685 | + 'noscript', |
|
686 | + 'video', |
|
687 | + ], |
|
688 | + true |
|
689 | + ) |
|
690 | + ) |
|
691 | + ) |
|
692 | 692 | || |
693 | 693 | ( |
694 | - $nextSibling instanceof \DOMElement |
|
694 | + $nextSibling instanceof \DOMElement |
|
695 | 695 | && |
696 | 696 | \in_array( |
697 | - $nextSibling->tagName, |
|
698 | - [ |
|
699 | - 'address', |
|
700 | - 'article', |
|
701 | - 'aside', |
|
702 | - 'blockquote', |
|
703 | - 'dir', |
|
704 | - 'div', |
|
705 | - 'dl', |
|
706 | - 'fieldset', |
|
707 | - 'footer', |
|
708 | - 'form', |
|
709 | - 'h1', |
|
710 | - 'h2', |
|
711 | - 'h3', |
|
712 | - 'h4', |
|
713 | - 'h5', |
|
714 | - 'h6', |
|
715 | - 'header', |
|
716 | - 'hgroup', |
|
717 | - 'hr', |
|
718 | - 'menu', |
|
719 | - 'nav', |
|
720 | - 'ol', |
|
721 | - 'p', |
|
722 | - 'pre', |
|
723 | - 'section', |
|
724 | - 'table', |
|
725 | - 'ul', |
|
726 | - ], |
|
727 | - true |
|
728 | - ) |
|
729 | - ) |
|
730 | - ) |
|
731 | - ); |
|
697 | + $nextSibling->tagName, |
|
698 | + [ |
|
699 | + 'address', |
|
700 | + 'article', |
|
701 | + 'aside', |
|
702 | + 'blockquote', |
|
703 | + 'dir', |
|
704 | + 'div', |
|
705 | + 'dl', |
|
706 | + 'fieldset', |
|
707 | + 'footer', |
|
708 | + 'form', |
|
709 | + 'h1', |
|
710 | + 'h2', |
|
711 | + 'h3', |
|
712 | + 'h4', |
|
713 | + 'h5', |
|
714 | + 'h6', |
|
715 | + 'header', |
|
716 | + 'hgroup', |
|
717 | + 'hr', |
|
718 | + 'menu', |
|
719 | + 'nav', |
|
720 | + 'ol', |
|
721 | + 'p', |
|
722 | + 'pre', |
|
723 | + 'section', |
|
724 | + 'table', |
|
725 | + 'ul', |
|
726 | + ], |
|
727 | + true |
|
728 | + ) |
|
729 | + ) |
|
730 | + ) |
|
731 | + ); |
|
732 | 732 | } |
733 | 733 | |
734 | 734 | protected function domNodeToString(\DOMNode $node): string |
@@ -756,9 +756,9 @@ discard block |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | $html .= '<!DOCTYPE ' . $child->name . '' |
759 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
760 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
761 | - . '>'; |
|
759 | + . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
760 | + . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
761 | + . '>'; |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | } else if ($child instanceof \DOMElement) { |