posthtml / posthtml-external-link

Add "rel='external noopenner nofollow'" and "target=_blank" to all external links
MIT License
11 stars 1 forks source link

Fixes: [rel=noreferrer] is not added when element has no existing [rel] #3

Closed richardneililagan closed 3 years ago

richardneililagan commented 3 years ago

When an element has no pre-existing [rel] (e.g. <a href="#">Example</a>), the config.noreferrer value is not respected. Even when config.noreferrer: true, the output HTML still does not include [rel=noreferrer].

This PR fixes that, so that config.noreferrer is respected regardless of what the pre-existing [rel] values are.

Scrum commented 3 years ago

@SukkaW ping