From 4b0cbaac38e4658f36688b648238a21fa8ba0194 Mon Sep 17 00:00:00 2001 From: Alfonso Bribiesca Date: Tue, 29 Jun 2021 10:15:43 -0500 Subject: [PATCH] feat: remove target and rel from internal link (#16) --- src/Extensions/Link/LinkRenderer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Extensions/Link/LinkRenderer.php b/src/Extensions/Link/LinkRenderer.php index 9f2e469..0dacc3b 100644 --- a/src/Extensions/Link/LinkRenderer.php +++ b/src/Extensions/Link/LinkRenderer.php @@ -2,6 +2,7 @@ namespace ARKEcosystem\CommonMark\Extensions\Link; +use Illuminate\Support\Arr; use Illuminate\View\ComponentAttributeBag; use League\CommonMark\ElementRendererInterface; use League\CommonMark\HtmlElement; @@ -47,7 +48,7 @@ public function render(AbstractInline $inline, ElementRendererInterface $htmlRen } if ($this->isInternalLink($attrs['href'])) { - $attrs = array_merge($attrs, config('markdown.link_attributes', [])); + $attrs = array_merge(Arr::only($attrs, ['href', 'id', 'class', 'name', 'title']), config('markdown.link_attributes', [])); return new HtmlElement('a', $attrs, $htmlRenderer->renderInlines($inline->children())); }