Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#662 closed Defect (fixed)

Problem with code/quote BBCodes in lists

Reported by: Thyme Lawn Owned by: davea
Priority: Minor Milestone: Undetermined
Component: Web - Forums Version:
Keywords: Cc:

Description

If a list item starts with a multiple line code or quote BBCode directive it isn't handled correctly. The special formatting is only applied to the first line, with all subsequent lines being formatted with just the list item indent. In addition, when you do a post preview everything after the first broken line appears outside the preview box, giving the impression that the post has been truncated.

Demonstration post on BOINC dev forum

Change History (9)

comment:1 Changed 16 years ago by Nicolas

I did some more tests (replies in the forum thread).

I think it would need quite a rewrite of the bbcode conversion code to fix this...

comment:2 Changed 16 years ago by Ageless

Summary: Problem with code/qoute BBCodes in listsProblem with code/quote BBCodes in lists

Fixed typo in title.

comment:3 in reply to:  description Changed 16 years ago by jbk

Unfortunately there's no simple way (afaik) to solve the problem of matching this with regex without using either recursion or a pushdown automaton. Think about nested lists of lists and the confusion this would give...

We can instead blame the BBCode people for making a badly designed standard without end-tags for list items and ignore the problem entirely since </li> is also optional in HTML 4.01 transitional.

comment:4 Changed 16 years ago by jbk

Fixed in revision 16080

comment:5 in reply to:  4 Changed 16 years ago by jbk

Replying to jbk:

Fixed in revision 16080

Typo in a 3 char fix (eek!) fixed in revision 16081

comment:6 Changed 16 years ago by Nicolas

BTW, say "Fixes #662" in the commit message to make Trac automatically close the ticket (it seems to allow six different spellings and even multiple ticket numbers separated by "and", but not the word "ticket" in the middle).

comment:7 Changed 16 years ago by Nicolas

Resolution: fixed
Status: newclosed

comment:8 in reply to:  6 ; Changed 16 years ago by jbk

Replying to Nicolas:

BTW, say "Fixes #662" in the commit message to make Trac automatically close the ticket (it seems to allow six different spellings and even multiple ticket numbers separated by "and", but not the word "ticket" in the middle).

ticket_prefix = '(?:#|(?:ticket|issue|bug)[: ]?)'

Seems you are right, pretty much the only syntax which isn't allowed is "ticket #xxx".

comment:9 in reply to:  8 Changed 16 years ago by jbk

Hm.. or perhaps it's because I used capital "T"?

Note: See TracTickets for help on using tickets.