Quantcast
Channel: All in the head
Viewing all articles
Browse latest Browse all 10

Adding the noopener attribute to CommonMark

$
0
0

Over on Notist I’m using the PHP League CommonMark Markdown parser to convert Markdown to HTML.

One recommendation that Google’s Lighthouse audits recommend is that rel="noopener" be added to any external links. There’s an entire article explaining why this is a positive move for both security and performance.

I initially couldn’t figure out how best to do this, but it turns out it’s really simple. CommonMark enables you to specify and register custom renderers and they even have an example of one for adding a class to external links. All I needed to do was slightly...


Viewing all articles
Browse latest Browse all 10

Trending Articles