Thread Tools Display Modes
10-06-16, 05:21 AM   #1
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-06-16, 11:54 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-06-16 at 12:02 PM.
  Reply With Quote
10-08-16, 01:04 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-08-16, 01:58 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Though if you quote with your reply, the original text retains tabs if they were used.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Site Forums » Site help, bugs, suggestions/questions » Bug with "highlight" BBCode tag

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off