News:

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

Main Menu

2 bbcode glitches

Started by bob799, August 17, 2016, 06:38:51 PM

Previous topic - Next topic

bob799

I have noticed a couple of bbcode glitches which is also on this forum aswell.

the 2 codes are

Insert Unordered List & Insert Ordered List

the code has been doubled up and there for puts an extra dot or number after the name on list. How do I edit the bbcodes to correct it?

Quotelist
li][/li
li][/li
/list

IF you take a look after hitting bbcode button there are 2 sets of li][/li when it needs to be 1. Can anyone help me find a fix to this so my users don't have to manually delete 1 of the li][/li in the code manually?

Had to remove some brackets because dots would appear on here otherwise.

Kindred

Actually, no...   this is not a glitch. It is working exactly the way it is supposed to work.  You do not usually have a list of ONE item...  therefore, the BBC button adds the list start and end and TWO item lines...

completely intentional and as designed
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nend

I moved your topic to the Coding Discussion board as this is more of a customization and I believe your looking into how to achieve this for your forum.

In /Sources/Subs-Editor.php
Find
array(
'image' => 'list',
'code' => 'list',
'before' => '[list]\n[li]',
'after' => '[/li]\n[li][/li]\n[/list]',
'description' => $txt['list_unordered']
),
array(
'image' => 'orderlist',
'code' => 'orderlist',
'before' => '[list type=decimal]\n[li]',
'after' => '[/li]\n[li][/li]\n[/list]',
'description' => $txt['list_ordered']
),


Replace
array(
'image' => 'list',
'code' => 'list',
'before' => '[list]\n[li]',
'after' => '[/li]\n[/list]',
'description' => $txt['list_unordered']
),
array(
'image' => 'orderlist',
'code' => 'orderlist',
'before' => '[list type=decimal]\n[li]',
'after' => '[/li]\n[/list]',
'description' => $txt['list_ordered']
),


However list are usually used for more than one item. If you change your mind you can always use •, to achieve what you want. It isn't on the keyboard and may be difficult for some users to find.

bob799

Quote from: Kindred on August 17, 2016, 08:25:17 PM
Actually, no...   this is not a glitch. It is working exactly the way it is supposed to work.  You do not usually have a list of ONE item...  therefore, the BBC button adds the list start and end and TWO item lines...

completely intentional and as designed

In regards to that reply. If you highlight a list yourself before the bbcode then activate the BBCode button you get the following..


  • test1
    test2

it is better a highlighted version just as in a word processor than individually entering yourself.

Kindred

yes, that is true... it does that.
however, it's still not a bug. :)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: