Install this theme component
Features
This theme component removes dashes from tag names wherever they’re displayed in the UI.
As Discourse replaces spaces in tag names with dashes, this theme component is useful for visually changing back dash
→ space
in the display.
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Last edited by @JammyDodger 2024-06-22T12:55:26Z
Check document Perform check on document:
14 Likes
Thank for your component,
Remove Dash from Tags side bar is OK, How about title Tag?
%{filter} %{tag} %{category}
Thank you for this. I could never understand the dashes there
The current theme component still misses many positions where the hyphen of the Tag Name cannot be removed, especially the website title to be friendly to Google. Can you update it?
1 Like
MarkoK
(Marko)
April 1, 2025, 8:35am
21
When enabling this theme component it also removes Tag icons from tags. So a bit conflict with this component: Tag Icons
Also as said before it misses removing those pesky dashes in few places.
1 Like
eisammy
(Dreadwhole)
April 7, 2025, 10:39pm
22
This script replace this component for awhile
function replaceTextNodes(node) {
node.childNodes.forEach(child => {
if (child.nodeType === Node.TEXT_NODE) {
child.textContent = child.textContent
.replace(/-E-/gi, ' & ')
.replace(/-/g, ' ');
} else {
replaceTextNodes(child);
}
});
}
api.onPageChange(() => {
document.querySelectorAll('.discourse-tag.box').forEach(tag => {
replaceTextNodes(tag);
});
document.querySelectorAll('#sidebar-section-content-tags .sidebar-section-link-content-text').forEach(tag => {
replaceTextNodes(tag);
});
});