كيفية استبدال النص في المنشئ؟

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?

3 إعجابات

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.

3 إعجابات

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

إعجابَين (2)

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

4 إعجابات

أرى أن هذا لم يُنفذ بعد. على الرغم من إضافة خيار استبدال الكلمات ضمن الكلمات الخاضعة للمراقبة، إلا أنه لا يسمح باستبدال كلمة بكود HTML. أحتاج إلى إمكانية استبدال كلمات معينة بكود HTML.

علاوة على ذلك، إذا كان بإمكان أي شخص آخر توجيهي إلى مورد لدمج جزء من HTML في منشور واحد، يرجى إخباري بذلك.

إعجاب واحد (1)

يمكنك استبدال الكلمات بكلمات أخرى، أو استبدال كلمة (أو كلمات) برابط. يمكنك فعل ذلك عبر لوحة الإدارة → تخصيص → الكلمات المرصودة. هذا الإجراء متاح منذ إصدار Discourse 2.7 وما بعده.

لكن لا يمكنك استبدال الكلمات بعلامات تنسيق (markup) بسبب القيود الموجودة في خط معالجة العرض لدينا.