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 Me gusta
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 me gusta
MarkoK
(Marko)
1 Abril, 2025 08:35
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 me gusta
eisammy
(Sammy)
7 Abril, 2025 22:39
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);
});
});
1 me gusta