stepmania-site icon indicating copy to clipboard operation
stepmania-site copied to clipboard

proper bbcode for <ul> and <li>

Open SoonDead opened this issue 11 years ago • 2 comments

Now contrary to the formatting help present under the reply textarea, the [ulist] and [*] tags don't work.

I want lists.

SoonDead avatar Jan 15 '14 10:01 SoonDead

Yeah, yeah, I know. It was on my note from when I replaced the parser. I'm just not sure if I want to enforce correctness or just allow it to output slightly broken HTML, or if I should run the post through another filter to make sure <li> always has a <ul>.

shakesoda avatar Jan 15 '14 16:01 shakesoda

I would go for

  1. Either a recruiting parser style bbcode, where every line is a list item.
  2. Or try to enforce valid html, with [*] tags only working inside [ulist] (or simply [ul] tags).

The first has the advantage that it's very easy-to-use for the end users (anything you write between [ul] and [/ul] is valid), but doesn't make it possible to use line breaks inside list items. (Well unless a [br] tag is also implemented which translates to <br> but is not a line break in itself before the parse happens.)

The second one is harder to implement, and also prone to break (too easy to make something invalid that does not parse as a list).

Also it is not just the question of <li> having an <ul> as parent <ul> having other children from <li>. I don't really like the phpBB list parser implementation, where

[list]
First line
Second line
[*]Third line with a bullet
Fourth line[/list]

Results in:

<ul>
    First line<br>
    Second line<br>
    <li>Third line<br>
    Fourth line</li>
</ul>

it is clearly not valid html, but it's straightforward ([*] means bullet at the beginning of the line, no [*] means no bullet) and produces visually appealing results.

SoonDead avatar Jan 17 '14 08:01 SoonDead