JSFiddle - React, Tailwind, and code Playground
HTML
<div class="block">
<h2><a href="/tag/music">music</a></h2>
<span>musician</span>
<span>rock</span>
<span>pop</span>
<span>indie</span>
<span>classical</span>
</div>
JavaScript
$(function(){
$(".block span").each(function(){
$(this).wrapInner("<a/>");
$(this).find("a").attr("href","/tag/"+encodeURIComponent($(this).html()));
})
})