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 个赞
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 个赞
MarkoK
(Marko)
2025 年4 月 1 日 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 个赞
eisammy
(Sammy)
2025 年4 月 7 日 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 个赞