WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Site help, bugs, suggestions/questions (https://www.wowinterface.com/forums/forumdisplay.php?f=18)
-   -   Bug with "highlight" BBCode tag (https://www.wowinterface.com/forums/showthread.php?t=54606)

Phanx 10-06-16 05:21 AM

Bug with "highlight" BBCode tag
 
When the first line of a code block has indentation, the "highlight" tag removes it, while the "code" tag does not. Compare:

Code:

        if UnitIsUnit(unit, "player") then
                return true
        end

Lua Code:
  1. if UnitIsUnit(unit, "player") then
  2.         return true
  3.     end

SDPhantom 10-06-16 11:54 AM

Looks like [highlight] is trimming all whitespace at the beginning of the code while [code] only checks for a newline at the beginning, subsequent newlines are left alone. Both of them trim all whitespace at the end of the code, which is probably a good thing.

If I had to guess, it seems like the original programmer of the parser wanted to reset the baseline indentation in [highlight], but couldn't figure out how to fully implement it.

Phanx 10-08-16 01:04 AM

I just noticed [highlight] also turns tab characters into spaces, which is also undesirable IMO. If I'm posting code, I want to to be displayed as written -- otherwise I'd have written it differently.

SDPhantom 10-08-16 01:58 AM

Though if you quote with your reply, the original text retains tabs if they were used.


All times are GMT -6. The time now is 12:07 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI