איך להחליף טקסט במלחין?

סיכום מבוסס בינה מלאכותית

The discussion revolves around replacing text in the Discourse composer, particularly for custom BBcode without closing tags and replacing substrings like [br ] with HTML. Newuser seeks a solution for replacing text without closing tags, referencing existing BBcode methods. codinghorror suggests a feature request for a “substitute/replace” section in Admin → Logs → Watched Words, which was acknowledged by sam for inclusion in Discourse 2.7. jughead notes that while word replacement is now possible in Discourse 2.7, HTML replacement is still not supported due to rendering limitations, as confirmed by codinghorror.

Hi all,

I have a very simple question, but I can’t find the answer anywhere.
I want to create custom BBcode without a closing tag, how do I do that?

Thanks to this topic I already figured out how to replace [something]something else[/something] with html code.

But now I would like to find out how to just replace [something]. For instance, I would like to know how to replace [br] with <br>. Or just any substring (not containing a closing tag) with something else. I already looked at the source of the discourse-bbcode plugin, but every bbcode in that plugin has a closing tag.

Basically I am looking for something like this:

But then something that still works.
Can someone help me or point me in the right direction?

One feature request that keeps coming up is a “substitute / replace” section in Admin → Logs → Watched Words.

I still think we should do this @sam and @eviltrout though it could be a 2.7 or beyond thing.

That would be really great, as long as the replacement allows HTML :smiley:

For 2.7 I did slot linked words, we can surely add this as well while at it… will add to the release.

I see this still hasn’t been done. Although the option to replace words was added under watched words, it does not allow to replace a word with HTML code. I need the ability to have certain words replaced by HTML.

Furthermore, if anyone else can point me to a resource to embed a piece of html in a single post, please let me know.

You can replace words with other words, or you can replace word(s) with a link. Do this via Admin → Customize → Watched Words. That’s as of Discourse 2.7 and later.

But you can’t replace words with markup due to limitations in our rendering pipeline.