Skip to content

Commit 88b5a83

Browse files
committed
Latte: n:href prints line
1 parent 3137e5d commit 88b5a83

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Bridges/ApplicationLatte/Nodes/LinkNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static function create(Tag $tag): ?static
4545

4646
if ($tag->isNAttribute()) {
4747
// move at the beginning
48+
$node->position = $tag->position;
4849
array_unshift($tag->htmlElement->attributes->children, $node);
4950
return null;
5051
}

tests/Bridges.Latte3/expected/isLinkCurrent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
%A%
22
echo '<a href="';
3-
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default'));
3+
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default')) /* line 1 */;
44
echo '"';
55
echo ($ʟ_tmp = array_filter([$presenter->isLinkCurrent() ? 'current' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" /* line 1 */;
66
echo '>n:href before n:class</a>
77

88
<a href="';
9-
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default'));
9+
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default')) /* line 3 */;
1010
echo '"';
1111
echo ($ʟ_tmp = array_filter([$presenter->isLinkCurrent() ? 'current' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" /* line 3 */;
1212
echo '>n:href after n:class</a>
@@ -24,7 +24,7 @@
2424
echo '">href after n:class</a>
2525

2626
<a href="';
27-
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default'));
27+
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default')) /* line 9 */;
2828
echo '"';
2929
echo ($ʟ_tmp = array_filter([($this->global->fn->isLinkCurrent)('default') ? 'current' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" /* line 9 */;
3030
echo '>custom function</a>

0 commit comments

Comments
 (0)