Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proper bbcode for <ul> and <li> #18

Open
SoonDead opened this issue Jan 15, 2014 · 2 comments
Open

proper bbcode for <ul> and <li> #18

SoonDead opened this issue Jan 15, 2014 · 2 comments

Comments

@SoonDead
Copy link
Contributor

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

I want lists.

@shakesoda
Copy link
Member

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>.

@SoonDead
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants