Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 4b0cbaa

Browse files
authored
feat: remove target and rel from internal link (#16)
1 parent c516188 commit 4b0cbaa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Extensions/Link/LinkRenderer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace ARKEcosystem\CommonMark\Extensions\Link;
44

5+
use Illuminate\Support\Arr;
56
use Illuminate\View\ComponentAttributeBag;
67
use League\CommonMark\ElementRendererInterface;
78
use League\CommonMark\HtmlElement;
@@ -47,7 +48,7 @@ public function render(AbstractInline $inline, ElementRendererInterface $htmlRen
4748
}
4849

4950
if ($this->isInternalLink($attrs['href'])) {
50-
$attrs = array_merge($attrs, config('markdown.link_attributes', []));
51+
$attrs = array_merge(Arr::only($attrs, ['href', 'id', 'class', 'name', 'title']), config('markdown.link_attributes', []));
5152

5253
return new HtmlElement('a', $attrs, $htmlRenderer->renderInlines($inline->children()));
5354
}

0 commit comments

Comments
 (0)