BBCodeParser icon indicating copy to clipboard operation
BBCodeParser copied to clipboard

No list functionality for single tags

Open marksyzm opened this issue 10 years ago • 2 comments

Nearly all BBCode engines I've used in the past use the following format:

[list]
[*]List item 1
[*]List item 2
[*]List item 3
[/list]

Same as:

<ul>
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
</ul>

But this is impossible with the parser in its current set up. I can have a look to alter it one day, but I don't know if I'll find the time. Can you help with this?

marksyzm avatar Nov 14 '15 00:11 marksyzm

The easiest way is to implement this is when parsing and encountering a [] tag and the previous tag is a [] tag, we see this as the end tag for the previous tag and the start tag of the current. We also need to see [/list] tag as the end tag for [*] tag.

This is not such a nice solution, but probably the easiest one to implement.

svenslaggare avatar Nov 15 '15 14:11 svenslaggare

@svenslaggare agreed, checking that anything following a [*] tag with an open close bracket regardless of content will probably do it.

marksyzm avatar Nov 15 '15 14:11 marksyzm