באג קל ב-Composer: פירוש BBCode

Hello Well, I have noticed that it is no longer possible to have the markdown editor enabled exclusively, you can have it default to one or the other of course, which is quite nice. However, I’m still noticing some inconsistent behaviour on my site (and here) with respect to the interpretation of BBCode. I know that the new composer isn’t meant to interpret BBCode and in the strictest sense that is true. Try typing [i] or [b], or indeed any of the familiar BBCode tags, doesn’t work in the composer (as expected). However, there is one case in which this is not true. If you were to type

[u]

I put that inside a code block, because if you don’t, the composer switches to an underline mode that you cannot turn back off.

Once you’re on a new line you’re fine of course, but I think this is unexpected behaviour from the composer…it seems to interpret this one BBCode and no others, but I understand it’s not supposed to interpret BBCode at this stage! I don’t think it’s a very serious bug, but I report it anyway for the sake of consistency and ease of reproduction, it seems to be quite easy to achieve both here and on my own site :slight_smile:

Thanks very much!

2 לייקים

תודה שהעלית את זה — רק בדיקה מהירה: האם אתה בטוח שתמיכה ב-BBCode מופעלת בפועל במופע שלך?

כדאי לבדוק שוב את קובץ ה-app.yml שלך — במהלך הגל האחרון של תוספים שעברו לליבה (core), חלק מהמנהלים השאירו בטעות שורות של תוספים במקום או העירו אחרות מתוך הנחה שהן כבר לא נחוצות. בעוד ש-BBCode עצמו נתמך על ידי הליבה ואינו דורש שורת תוסף, אם אתה מסתמך על התנהגות BBCode מורחבת (כמו קו תחתון או יישור), קל לאבחן את הבעיה בצורה שגויה.

כמו כן, קח בחשבון: BBCode פועל רק במצב Markdown. אם אתה משתמש במלחין (composer) החדש של עריכה עשירה (rich-text), הוא לא יפרש תגי BBCode כמו [b]מודגש[/b] — הם פשוט יברחו (escaped). מעבר חזרה למלחין הרגיל אמור להחזיר את ההתנהגות הצפויה.

2 לייקים

No problem, I hope that helps! I did check my app.yml but I didn’t see any references or environment variables that were setting anything related to BBCode… It seems to work on my own instance (and here) though, I’m in the Markdown editor at the moment and if I switch to using BBCode instead of Markdown for formatting, it seems to work as expected. The only place that the new composer doesn’t seem to work as expected is in the case of [u], it evidently ignores every other BBCode exactly as intended. :slight_smile:

It’s a bit of a strange one and not too serious, but if there is any other information I can provide please let me know!

They’re not expected to work indeed, as using Markdown is preferred.

What can be done as a follow-up is auto-convert a typed [b] to bold, and [i] to italics, which will respectively serialize back to Markdown as **bold** and *italics*. We already do this for <b> and <i> as similarly we don’t want to incentivize the use of HTML when a Markdown syntax is available.

[u], being the only way to format an underline and supported by Discourse core, is supported as-is.

The “turn back off” issue is something we intend to improve for underline, strikethrough, and potentially other types of contents. /cc @lindsey

4 לייקים