dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
2326
share rss forum feed


Johnny
Fed Up. Bye.
Premium
join:2001-06-27
Atlanta, GA
kudos:2

1 recommendation

[request] Code Tags

When using the "[ code ]" tags, could we have the formatted code block be about 20 characters wider? It isn't as wide as the "bquote" blocks and it's not obvious why not.

Compare:
if [ $publicIP != $savedIP ]; then
defaults write com.jlsoftware.updateDSLR IP -string $publicIP
curl -m 10 -u $userID:$dslrPW "http://www.dslreports.com/nic?action=edit&started=1&host_id
*=$dslrHost&myip=$publicIP"
fi

(*) WARNING 1 long line(s) split

if [ $publicIP != $savedIP ]; then
defaults write com.jlsoftware.updateDSLR IP -string $publicIP
curl -m 10 -u $userID:$dslrPW "http://www.dslreports.com/nic?action=edit&started=1&host_id=$dslrHost&myip=$publicIP"
fi
The code tags result in a split line, but the bquote tags don't.

Pretty please??


justin
..needs sleep
Australian
join:1999-05-28
kudos:15
Reviews:
·iiNet

Re: Code Tags

at least on my browser, the font for bquote and code is different. The font used for code is quite a bit larger.

If IE would fix their browser and allow horizontable scrolling blocks without using iframes (such as firefox etc does) the whole problem would go away.


Johnny
Fed Up. Bye.
Premium
join:2001-06-27
Atlanta, GA
kudos:2
said by justin:

at least on my browser, the font for bquote and code is different. The font used for code is quite a bit larger.

If IE would fix their browser and allow horizontable scrolling blocks without using iframes (such as firefox etc does) the whole problem would go away.
I'll post the screenshot to show that the code font is actually much smaller than the bquote font on Safari.




justin
..needs sleep
Australian
join:1999-05-28
kudos:15
yes, every browser has a different idea about the size of fixed width fonts, despite specifying them the same way this end. Unfortunately, with IE, and firefox and windows, the code tends to take up more space than the regular text.


rjackson
Premium,VIP,MVM,Ex-Mod 2005-13
join:2002-04-02
Ringgold, GA
kudos:1
reply to justin
said by justin:

If IE would fix their browser and allow horizontable scrolling blocks without using iframes (such as firefox etc does) the whole problem would go away.
So you're saying IE wouldn't support overflow: auto in the code div? Would it be possible to add in functionality for other browsers then?


Johnny
Fed Up. Bye.
Premium
join:2001-06-27
Atlanta, GA
kudos:2
reply to justin
I don't know HTML that well so I have to admit being still confused. I just noted that there are 3 inches of blue space on the right side of the formatted code block and yet it still split the line. It seems to split it at 91 characters.


justin
..needs sleep
Australian
join:1999-05-28
kudos:15
Reviews:
·iiNet
reply to rjackson
Unfortunately not because, if you notice, the line breaking is done in the database, not upon display, which is probably too expensive.
So as long as the "most popular" browser blows its margins then we are stuck with the lowest common denominator.


rjackson
Premium,VIP,MVM,Ex-Mod 2005-13
join:2002-04-02
Ringgold, GA
kudos:1
said by justin:

Unfortunately not because, if you notice, the line breaking is done in the database, not upon display, which is probably too expensive.
So as long as the "most popular" browser blows its margins then we are stuck with the lowest common denominator.
Hey, this is something I've seen in Firefox but never in Safari before:


I like it. Are you still line breaking in the database too?


justin
..needs sleep
Australian
join:1999-05-28
kudos:15
Reviews:
·iiNet
No. Msie starts to work (adds the scrollbar) if you fix the width in the css. Which is a shame as the width should be auto picked to stay within the surrounding table. But at least I don't have to snap lines anymore.

Also older browsers will lose now.


rjackson
Premium,VIP,MVM,Ex-Mod 2005-13
join:2002-04-02
Ringgold, GA
kudos:1
Oh, neat...I like this better.


Johnny
Fed Up. Bye.
Premium
join:2001-06-27
Atlanta, GA
kudos:2
reply to justin
This is superb. Thanks Justin!

Copy and paste of code now is a breeze.


eightyone x
Premium
join:2002-05-28
kudos:1
reply to rjackson
Click for full size
there is a height issue with IE when the code is only one line.
example: »Thank you! -- Topic mouseovers.


justin
..needs sleep
Australian
join:1999-05-28
kudos:15
yes, I couldn't find the fix, however. IE is buggy.


PapaDos
Cum Grano Salis
Premium,MVM
join:2001-02-08
Lasalle, QC
kudos:3
reply to Johnny
Sorry to wake up an old thread !

Maybe adding a blank line or two automatically at the end would help ?
--
Festina Lente


MorWired
Premium
join:2001-03-03

1 edit
said by PapaDos:
Sorry to wake up an old thread !

Maybe adding a blank line or two automatically at the end would help ?
Or some transparent character/code. When I posted a one-line code block yesterday I just added in a carriage return (broke up the line between codes), but an automatic insertion of something beginning or end should take care of the problem without being terribly unsightly or taking up much extra space.
--
Get your daily dose of wonder from the Astronomy Picture of the Day (APOD).



PapaDos
Cum Grano Salis
Premium,MVM
join:2001-02-08
Lasalle, QC
kudos:3
reply to Johnny
It seems adding only one line (CR/LF) at the end would work pretty well...
--
Festina Lente


Johnny
Fed Up. Bye.
Premium
join:2001-06-27
Atlanta, GA
kudos:2
said by PapaDos:

It seems adding only one line (CR/LF) at the end would work pretty well...
Then when someone copies and pastes the block into their shell, it will hit Return, which often is not what is wanted. The person copying and pasting may need to add text to the pasted line before executing the command, and having a CR/LF that was not part of the original text would defeat that purpose.

Also I think CR/LF is a Windows-specific line ending. All hell would break loose with Mac or Unix users trying to figure out why their code was crapping out.
--
»homepage.mac.com/johnnylundy/Fil ··· g27.html