This is basically exactly how my function &quot;cre&quot; works (except you can omit the empty attribute object): <a href="https:&#x2F;&#x2F;github.com&#x2F;stuartpb&#x2F;cre" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stuartpb&#x2F;cre</a>