Skip to content

Instantly share code, notes, and snippets.

@mikka2061
Last active December 15, 2021 06:12
Show Gist options
  • Save mikka2061/c2e6f75a39c82251e5a75daa8f8a5ff7 to your computer and use it in GitHub Desktop.
Save mikka2061/c2e6f75a39c82251e5a75daa8f8a5ff7 to your computer and use it in GitHub Desktop.
Turn #tags into links
$(document).ready(function(){
var link_entries = $('div.f-entry > p, div.f-entry > ul > li');
if ( link_entries.length > 0 ) {
for (i = 0; i < link_entries.length; i = i + 1) {
link_entries[i].innerHTML = link_entries[i].innerHTML.replace(/ #(\S+)/g,' <a class="tagz" href="/tagged/$1" title="Find more posts tagged with #$1">#$1</a>');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment