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

Commit

Permalink
feat: remove target and rel from internal link (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsobries authored Jun 29, 2021
1 parent c516188 commit 4b0cbaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Extensions/Link/LinkRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
}
Expand Down

0 comments on commit 4b0cbaa

Please sign in to comment.