החלף לאופן הפרדת רשימות התגים

Lists of tags on topics in Discourse are separated by commas by default. This isn’t changing, but how it’s implemented and how you can change it has:

Previously we used a CSS pseudo element to add the commas, which isn’t ideal because the content isn’t technically available as part of the document — screenreaders can’t access it, they’re not selectable, web crawlers can’t see them…

This change merged today moves the tag separators to proper HTML: FEATURE: customizable tag separator with value transformer in proper HTML by awesomerobot · Pull Request #31674 · discourse/discourse · GitHub

For most sites this won’t change anything obvious, but if you previously removed or changed the tag separator you’ll have to use a value transformer instead of CSS.

This is a fairly straightforward process with JS, for example if you want to remove the comma entirely:

import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  api.registerValueTransformer("tag-separator", () => "");
});

or if you want to use a pipe separator

import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  api.registerValueTransformer("tag-separator", () => "|");
});

coupled with a little CSS:

.discourse-tags__tag-separator {
  margin-inline: 0.25em;
}

Let us know if you encounter any issues with this change!

We are seeing duplicate commas:

Probably one comes from the new HTML code and the other comes from the custom theme CSS (old code).

The former (HTML) is indeed selectable, while the latter (CSS) is not.

Following this change, all custom themes should be fixed, apparently?

From what I see on your forum, it’s related to Multilingual Plugin 🌐 .

It still uses the old way with CSS pseudo elements.
This CSS could be removed.

וואו! תודה על האבחנה המהירה שלך!

שלום ארקלסיין,

רציתי לנסות ולהתקין את תוסף הרב־לשוני וכשניסיתי זה הופיע עם הפסיקים הכפולים. כשאני מנסה לבטל את ההפעלת התוסף השפה שלי הופכת לאנגלית (ולכן הפסיקים הכפולים נעלמים). כאשר אני מפעיל אותו שוב זה שוב השפה שלי.

האם אתה חושב שכדאי לי להסיר את התוסף אם אני לא באמת צריך אותו כרגע, ואם כן, למה השפה עכשיו באנגלית? ה’שפת ברירת מחדל’ ריקה כשמבטלים את תוסף הרב־לשוני.

אם התוסף לא משפיע על האתר בשום אופן אולי אפשר להשאירו ולנסות להסיר את הפסיקים הכפולים.

בברכה,
אולה

עריכה: פתרתי את הבעיה על ידי הסרת התוסף

It seems that the separator is hidden by default when the tag style is box or bullet:

.discourse-tags .box + .discourse-tags__tag-separator, 
.discourse-tags .bullet + .discourse-tags__tag-separator {
  display: none;

However, this is overwritten on the mobile list by a more specific declaration. So on mobile the separator shows: