dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
2476

Johnny34
Fed Up. Bye.
Premium Member
join:2001-06-27
Atlanta, GA

1 recommendation

Johnny34

Premium Member

[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
Mod
join:1999-05-28
2031
Billion BiPAC 7800N
Apple AirPort Extreme (2011)

justin

Mod

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.

Johnny34
Fed Up. Bye.
Premium Member
join:2001-06-27
Atlanta, GA

Johnny34

Premium Member

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
Mod
join:1999-05-28
2031

justin

Mod

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

join:2002-04-02
Ringgold, GA
Netgear R6400
Switches Trash Bin
Apple AirPort Extreme (2011)

rjackson to justin

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?

Johnny34
Fed Up. Bye.
Premium Member
join:2001-06-27
Atlanta, GA

Johnny34 to justin

Premium Member

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
Mod
join:1999-05-28
2031
Billion BiPAC 7800N
Apple AirPort Extreme (2011)

justin to rjackson

Mod

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

join:2002-04-02
Ringgold, GA
Netgear R6400
Switches Trash Bin
Apple AirPort Extreme (2011)

rjackson

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
Mod
join:1999-05-28
2031
Billion BiPAC 7800N
Apple AirPort Extreme (2011)

justin

Mod

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

join:2002-04-02
Ringgold, GA

rjackson

Oh, neat...I like this better.

Johnny34
Fed Up. Bye.
Premium Member
join:2001-06-27
Atlanta, GA

Johnny34 to justin

Premium Member

to justin
This is superb. Thanks Justin!

Copy and paste of code now is a breeze.

eightyone x
Premium Member
join:2002-05-28

eightyone x to rjackson

Premium Member

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
Mod
join:1999-05-28
2031

justin

Mod

yes, I couldn't find the fix, however. IE is buggy.

PapaDos
Cum Grano Salis
MVM
join:2001-02-08
Drummondville, QC

PapaDos to Johnny34

MVM

to Johnny34
Sorry to wake up an old thread !

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

MorWired
Premium Member
join:2001-03-03

1 edit

MorWired

Premium Member

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.

PapaDos
Cum Grano Salis
MVM
join:2001-02-08
Drummondville, QC

PapaDos to Johnny34

MVM

to Johnny34
It seems adding only one line (CR/LF) at the end would work pretty well...

Johnny34
Fed Up. Bye.
Premium Member
join:2001-06-27
Atlanta, GA

Johnny34

Premium Member

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.