Lines Matching refs:node
34 foreach ($event->getDocument()->iterator() as $node) {
35 if (! ($node instanceof Attributes || $node instanceof AttributesInline)) {
39 [$target, $direction] = self::findTargetAndDirection($node);
48 $attributes = AttributesHelper::mergeAttributes($target, $node->getAttributes());
50 $attributes = AttributesHelper::mergeAttributes($node->getAttributes(), $target);
56 $node->detach();
61 * @param Attributes|AttributesInline $node
65 private static function findTargetAndDirection($node): array
69 $previous = $next = $node;
75 if (! $node->parent() instanceof FencedCode) {
76 $target = $node->parent();
83 if ($node instanceof AttributesInline && ($previous === null || ($previous instanceof AbstractInline && $node->isBlock()))) {
108 private static function getPrevious(?Node $node = null): ?Node
110 if ($node instanceof Attributes) {
111 if ($node->getTarget() === Attributes::TARGET_NEXT) {
115 if ($node->getTarget() === Attributes::TARGET_PARENT) {
116 return $node->parent();
120 return $node instanceof Node ? $node->previous() : null;
126 private static function getNext(?Node $node = null): ?Node
128 if ($node instanceof Attributes && $node->getTarget() !== Attributes::TARGET_NEXT) {
132 return $node instanceof Node ? $node->next() : null;
135 private static function isAttributesNode(Node $node): bool
137 return $node instanceof Attributes || $node instanceof AttributesInline;