BBCode in Topic Titles
Admin CP → Themes → Board Templates → Below the board
<script>
const links = document.querySelectorAll('a');
links.forEach(link => {
if (link.innerText.includes('[/')) {
link.innerHTML = link.innerHTML.replace(/\[b\](.*)\[\/b\]/g, '<strong>$1</strong>').replace(/\[i\](.*)\[\/i\]/g, '<em>$1</em>').replace(/\[u\](.*)\[\/u\]/g, '<span style="text-decoration: underline">$1</span>').replace(/\[s\](.*)\[\/s\]/g, '<span style="text-decoration: line-through">$1</span>').replace(/\[color=(.*)\](.*)\[\/color\]/g, '<span style="color: $1">$2</span>');
}
});
if (document.querySelector('div.breadcrumbs span') && document.querySelector('div.breadcrumbs span').innerText.includes('[/')) {
document.querySelector('div.breadcrumbs span').innerHTML = document.querySelector('div.breadcrumbs span').innerHTML.replace(/\[b\](.*)\[\/b\]/g, '<strong>$1</strong>').replace(/\[i\](.*)\[\/i\]/g, '<em>$1</em>').replace(/\[u\](.*)\[\/u\]/g, '<span style="text-decoration: underline">$1</span>').replace(/\[s\](.*)\[\/s\]/g, '<span style="text-decoration: line-through">$1</span>').replace(/\[color=(.*)\](.*)\[\/color\]/g, '<span style="color: $1">$2</span>');
}
if (document.querySelector('div.panel__title h2') && document.querySelector('div.panel__title h2').innerText.includes('[/')) {
document.querySelector('div.panel__title h2').innerHTML = document.querySelector('div.panel__title h2').innerHTML.replace(/\[b\](.*)\[\/b\]/g, '<strong>$1</strong>').replace(/\[i\](.*)\[\/i\]/g, '<em>$1</em>').replace(/\[u\](.*)\[\/u\]/g, '<span style="text-decoration: underline">$1</span>').replace(/\[s\](.*)\[\/s\]/g, '<span style="text-decoration: line-through">$1</span>').replace(/\[color=(.*)\](.*)\[\/color\]/g, '<span style="color: $1">$2</span>');
}
if (document.querySelector('title').innerText.includes('[/')) {
document.querySelector('title').innerText = document.querySelector('title').innerText.replace(/\[.+?\]/g, '');
}
</script>
ForumSpark Support