BBCode Whitespace Weirdness

Discussion in 'BukkitDev Information and Feedback' started by Pyho, Aug 15, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Pyho

    I'm working on formatting on one of my plugin's pages and I'm having some frustration with whitespaces in BBCode.
    The issue is, occasionally when something has any sort of BBcode tags, the things immediately following the tags will not respect new lines.

    Example:
    Code:
    [u][b][color=green]/xbp config warningparameters [add/remove/list] (ids)[/color][/b][/u]
    Adds, removes, or lists parameters to warn against.
    [b]Order corresponds to order of warningblockids.[/b]
    Format of a parameter is: percent,amount
    Results in:
    [​IMG]

    But:

    Code:
    [u][b][color=green]/xbp config warningparameters [add/remove/list] (ids)[/color][/b][/u]
    Adds, removes, or lists parameters to warn against.
    [color=red][b]Order corresponds to order of warningblockids.[/b][/red]
    Format of a parameter is: percent,amount
    Results in:
    [​IMG]

    If, instead, I do:
    Code:
    [u][b][color=green]/xbp config warningparameters [add/remove/list] (ids)[/color][/b][/u]
    Adds, removes, or lists parameters to warn against.
     
    [color=red][b]Order corresponds to order of warningblockids.[/b][/red]
     
    Format of a parameter is: percent,amount
    I get:
    [​IMG]

    I've had this happen with size and bold tags, among others. This will also happen with lists, where if it put an extra line without tags in a section of a list, it will respect indentation on that line and if I do put tags, it won't. And it doesn't seem to be very consistent. All of the stuff posted above has bold tags, but there are times where I'll use a bold tag and it will result in the same problem. It's not a huge issue (more of an inconvenience), but I'd like to know if I'm missing something.
    Or maybe I should just not be using BBcode?
     
  2. Offline

    Pyho

    Aaanyone? D:
     
  3. Offline

    chaseoes

    No clue what you're talking about.
     
  4. Offline

    Pyho

    BBCode on BukkitDev seems to do weird things to whitespace, essentially.
     
  5. Offline

    HollowCube

    @Pyho I tweaked your BB Code to make it work the way you want it to:

    Code:
    [u][b][color=green]/xbp config warningparameters [add/remove/list] (ids)[/color][/b][/u]
    Adds, removes, or lists parameters to warn against.
    [b][color=red]Order corresponds to order of warningblockids.[/color][/b]
    Format of a parameter is: percent,amount
    /xbp config warningparameters [add/remove/list] (ids)
    Adds, removes, or lists parameters to warn against.
    Order corresponds to order of warningblockids.
    Format of a parameter is: percent,amount

    Don't use [/red] in your code, it's supposed to be [/color].

    I changed the below in your code:

    Old Code:
    Code:
    [color=red][b]Order corresponds to order of warningblockids.[/b][/red]
    New Code:
    Code:
    [b][color=red]Order corresponds to order of warningblockids.[/color][/b]
     
  6. Offline

    ZachBora

    You shouldn't close tags within a sub tag... should end with color and b after.
    Some bbcode engine have the [br] tag, doesn't seem to be in this one's list.
     
  7. Offline

    HollowCube

    Thanks for pointing that out. I edited the code in my last post to close the color tag before the bold tag.
     
Thread Status:
Not open for further replies.

Share This Page