News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Creating BBcodes with variants for SCEditor

Started by moyack, January 16, 2021, 10:44:08 PM

Previous topic - Next topic

moyack

Hello beloved SMF community:

I've been testing the latest version of this forum software (2.1RC3) and I'm impressed wih all the new features and good stuff done thus far.

But I need to implement some modifications and custom BBcode is a must for my purposes. I ran into a situation where I couldn't find a solution:

I want to implement a modification for de code tag ([code]). As you already know, this tag comes with 2 flavors:

1. [code]This is a code...[/code], which compiles to this: This is a code...

2. And [code=test]This is a code...[/code], which compiles to this:
Code (test) Select
This is a code...

With version 2.0.17 and older is was easy for me create a custom modification... but SCEditor seems to have a limitation with a BBcode with several presentations, mainly with the javascript part. In fact I'm outstanding a bug in SMF 2.1 with the BBcode tag.

(My SMF install is set to start the post editor in bbcode mode, not WYSIWYG mode)

  • I write the code #1 in the editor and everything works fine
  • I save the code #1 in the editor and everything works fine
  • I change the visualization to WYSIWYG mode and back, and it works fine, the text is not changed
  • I do click on modify the post with the code #1 in the editor shows the code as I wrote

For the #2 BBcode:

  • I write the code #2 in the editor and everything works fine,
  • I save the code #2 in the editor WITHOUT CHANGING TO WYSIWYG MODE and everything works fine
  • I do click on modify the post with the code #2 BUT the editor shows the post REMOVING the code #2

In this part I did another test:

  • I write the code #2 in the editor and everything works fine,
  • I changed to WYSIWYG mode and in shows the preview in the text editor. With the test "test" inlined with the tag content, but it shows something
  • I changed back to BBcode mode and it deletes ALL the code #2

Definitely it's a bug. I don't have any mods installed. I've checked several post to find any solution but I can't find any about setting a fix.

Topics reviewed:

moyack


live627


moyack

Quote from: live627 on February 20, 2021, 11:41:04 PM
Hi. Just now saw this and have prepared a fix https://github.com/SimpleMachines/SMF2.1/pull/6528

Thanks for the heads up.
Thanks for your work.

I can confirm it does work now. With your help I'm now understanding how to configure better this kind of situation of BBcode and create possible mods in this matter.

SMF forever!!!

Advertisement: