Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Nao on February 7th, 2013, 06:06 PM

Title: Tabs in code tags
Post by: Nao on February 7th, 2013, 06:06 PM
Hmm... Bug?

http://wedge.org/pub/7845/template-edits/msg285740/#msg285740

That post contains multiple lines for stuff that appears as a single line in my PHP code... The only 'special' thing these lines have, is multiple tabs between the function name declaration and the function code itself, due to a Naoism of mine[1].
 1. Well, a Naoism is always mine. Otherwise it would be called a fucked-up insignificant idea.
Title: Re: Tabs in code tags
Post by: Arantor on February 7th, 2013, 06:18 PM
Well, the tabs are presented *as* tabs. That's something that even SMF didn't do :whistle:

But it would seem that line breaks aren't being adhered to properly, which could be a preparsing bug.
Title: Re: Tabs in code tags
Post by: Nao on February 7th, 2013, 07:30 PM
Could you look into it..? I'm not 'in the right state of mind' for that bug right now :P
Title: Re: Tabs in code tags
Post by: Arantor on February 7th, 2013, 07:37 PM
It is a bug. (Also, Quick Reply STILL not opening for me :/)

OK, here's the deal. As part of the crap of making tab characters actually fucking work properly across browsers (mostly IE if I remember rightly), they are wrapped in a span, whose display is set to inline - which is when they wrap.

Now, setting bbc_span to inherit from inline-block should fix that[1], at least if I set .bbc_span to display:inline-block it seems to work for me, or at least it displays the lines without wrapping though nothing lines up for me, presumably because of different tab widths in the bbc vs your editor.
 1. It only needs display:inline-block but we know that IE requires more effort than that!
Title: Re: Tabs in code tags
Post by: Nao on February 7th, 2013, 09:09 PM
Quote from Arantor on February 7th, 2013, 07:37 PM
It is a bug. (Also, Quick Reply STILL not opening for me :/)
And still opening for me...
You'll have to give me:
1/ a copy of your html headers, more precisely what CSS and JS files are loaded
2/ what browser are you using exactly?
3/ does this happen on other browsers?
4/ does this happen on your localhost..?
Quote
OK, here's the deal. As part of the crap of making tab characters actually fucking work properly across browsers (mostly IE if I remember rightly), they are wrapped in a span, whose display is set to inline - which is when they wrap.

Now, setting bbc_span to inherit from inline-block should fix that[1], at least if I set .bbc_span to display:inline-block it seems to work for me, or at least it displays the lines without wrapping though nothing lines up for me, presumably because of different tab widths in the bbc vs your editor.
 1. It only needs display:inline-block but we know that IE requires more effort than that!
Oh... I see!
So... Do we change that? To inline-block or .inline-block?
Title: Re: Tabs in code tags
Post by: Arantor on February 7th, 2013, 09:28 PM
Quote from Nao on February 7th, 2013, 09:09 PM
Quote from Arantor on February 7th, 2013, 07:37 PM
It is a bug. (Also, Quick Reply STILL not opening for me :/)
And still opening for me...
You'll have to give me:
1/ a copy of your html headers, more precisely what CSS and JS files are loaded
2/ what browser are you using exactly?
3/ does this happen on other browsers?
4/ does this happen on your localhost..?
Here, Chrome 25 beta.

Code: [Select]
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Cache-Control:max-age=0
Connection:keep-alive
Cookie:__utma=80229137.1864365054.1340325117.1340325117.1340325117.1; ShyCookie=a%3A4%3A%7Bi%3A0%3Bs%3A4%3A%222367%22%3Bi%3A1%3Bs%3A40%3A%220a05100d0a53e8cec574453aaa2a40781116060f%22%3Bi%3A2%3Bi%3A1529541212%3Bi%3A3%3Bi%3A2%3B%7D; WedgeCookie42=a%3A4%3A%7Bi%3A0%3Bs%3A4%3A%222367%22%3Bi%3A1%3Bs%3A40%3A%224cfcd071692239cd226596aa07da84b79afd98fa%22%3Bi%3A2%3Bi%3A1543371041%3Bi%3A3%3Bi%3A3%3B%7D; PHPSESSID=irg14ti0nclk4j0o7ik45beiea3f87ic
DNT:1
Host:wedge.org
Pragma:no-cache
Referer:http://wedge.org/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.58 Safari/537.22

are the headers.

Loaded files:
member-chrome25-win6.1-1360172721.css.gz
smileys-cyna-1331891881.css.gz
editor/chrome25-win6.1-1359929457.css.gz

http://code.jquery.com/jquery-2.0.0b1.min.js
script-1360015538.js.gz
spellcheck-1359993190.js.gz
topic-1360172000.js.gz
editor-1359993192.js.gz

Code: [Select]
<script><!-- // --><![CDATA[
$("img.resized").click(function () { this.style.width = this.style.height = (this.style.width == "auto" ? null : "auto"); });
$(".actions").on("click, ".ip_button", function (e) { return reqWin(this); });

generates the Unexpeced token ILLEGAL on that last line because of the missing " after click.
Quote from Nao on February 7th, 2013, 09:09 PM
Quote
OK, here's the deal. As part of the crap of making tab characters actually fucking work properly across browsers (mostly IE if I remember rightly), they are wrapped in a span, whose display is set to inline - which is when they wrap.

Now, setting bbc_span to inherit from inline-block should fix that[1], at least if I set .bbc_span to display:inline-block it seems to work for me, or at least it displays the lines without wrapping though nothing lines up for me, presumably because of different tab widths in the bbc vs your editor.
 1. It only needs display:inline-block but we know that IE requires more effort than that!
Oh... I see!
So... Do we change that? To inline-block or .inline-block?
Well, it needs to become an inline-block element but we can't add class inline-block to it, aside from the bandwidth use, because inline-block is a virtual style (as I discovered), so we would need .bbc_span to extend the virtual .inline-block definition, and remove the display entry from its definition.

My bad, it's not bbc_span, it's bbc_pre

Code: [Select]
.bbc_pre
display: inline
white-space: pre
margin, padding: 0

I'm thinking it should be:
Code: [Select]
.bbc_pre extends .inline-block
white-space: pre
margin, padding: 0
Title: Re: Tabs in code tags
Post by: Nao on February 7th, 2013, 09:51 PM
Quote from Arantor on February 7th, 2013, 09:28 PM
Code: [Select]
<script><!-- // --><![CDATA[
$("img.resized").click(function () { this.style.width = this.style.height = (this.style.width == "auto" ? null : "auto"); });
$(".actions").on("click, ".ip_button", function (e) { return reqWin(this); });

generates the Unexpeced token ILLEGAL on that last line because of the missing " after click.
Didn't need all the headers if it was just that... :P
Okay, so here was the problem: it worked for me because as an admin, I see a different IP link on user names, which redirects me to the IP tracker, rather than a popup (which required the live function call.)
Sorry again...
Quote from Nao on February 7th, 2013, 09:09 PM
My bad, it's not bbc_span, it's bbc_pre
Changed, thank you :)
It works better indeed. The tab size isn't exactly faithful, but there are worse things than that. ;)
Title: Re: Tabs in code tags
Post by: Arantor on February 7th, 2013, 10:02 PM
Quote
I see a different IP link on user names, which redirects me to the IP tracker, rather than a popup (which required the live function call.)
Sorry again...
The popup doesn't work properly :/ It just gives me the popup in a regular page, not making it an actual popup. And I'm not an administrator.

In fact, I'm pretty sure I rewrote the underlying handling in the ban system so that the only people who could ever see IP addresses were people who would have ban access (and thus there's no need for the popup anyway)
Quote
It works better indeed. The tab size isn't exactly faithful, but there are worse things than that.
Heh, yup.
Title: Re: Tabs in code tags
Post by: Arantor on February 10th, 2013, 06:20 PM
Guessing this one is solved now.