Jump to content

codebox


pulpfiction

Recommended Posts

When I copy the text from a CODEBOX and paste in a text editor [to test the code], the line breaks doesnt work properly..... its pasted as a chunk of text, not with line breaks but just tab spaces. it gets really tough to go in and seperate the end of line. guess its nothing to do with the text editor [i use notepad++]. does this happen for anyone else? is there any workaround for this?

Link to comment
Share on other sites

It's not from the editor. And I'm not sure why is it like that. Anyhow, a workaround for it is to start a reply on the topic by quoting the post. You get a nice formatted version in a text box. Copying the text from there results in a fine pasted text.

Link to comment
Share on other sites

It's either the browser or the text editor, I paste from Opera into ConTEXT and everything works fine.
Thought that it was some thing to do with how codebox is coded..... in IE6 it sometimes even has horizontal scrollbars.
Link to comment
Share on other sites

As far as I know it's just a div with the overflow set to auto.. I don't think there's anything special about it.

testtest

<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>test<br /><br />test</div>.codetop,.sqltop,.htmltop{	background: #FDDBCC url(style_images/1/css_img_code.gif) no-repeat right;	color: #000;	font-weight: bold;	margin: 0 auto 0 auto;	padding: 3px;}.codemain,.sqlmain,.htmlmain{	background: #FAFCFE;	border: 1px dotted #000;	color: #465584;	font-family: Courier, Courier New, Verdana, Arial;	margin: 0 auto 0 auto;	padding: 2px;}

Link to comment
Share on other sites

Oh Im not asking about CODE, that fine. but CODEBOX is the problem. Try copying the code below into a text editor.

<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>test<br /><br />test</div>.codetop,.sqltop,.htmltop{    background: #FDDBCC url(style_images/1/css_img_code.gif) no-repeat right;    color: #000;    font-weight: bold;    margin: 0 auto 0 auto;    padding: 3px;}.codemain,.sqlmain,.htmlmain{    background: #FAFCFE;    border: 1px dotted #000;    color: #465584;    font-family: Courier, Courier New, Verdana, Arial;    margin: 0 auto 0 auto;    padding: 2px;}

Link to comment
Share on other sites

Oh Im not asking about CODE, that fine. but CODEBOX is the problem. Try copying the code below into a text editor.
The box with the test text in it is a codebox, the following box shows the HTML and CSS for the codebox. There's nothing special about it, the line breaks are still <br> tags. In fact, the style attribute on the div is the only difference between codebox and code:<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
Link to comment
Share on other sites

Oh Im not asking about CODE, that fine. but CODEBOX is the problem. Try copying the code below into a text editor.
I lose indentation when I paste that text into either Notepad.exe or Visual Studio 2005.
Link to comment
Share on other sites

When I copy and paste the above code into notepad it looks like this.. so its something to do with browser.<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>test<br /><br />test</div>.codetop,.sqltop,.htmltop{ background: #FDDBCC url(style_images/1/css_img_code.gif) no-repeat right; color: #000; font-weight: bold; margin: 0 auto 0 auto; padding: 3px;}.codemain,.sqlmain,.htmlmain{ background: #FAFCFE; border: 1px dotted #000; color: #465584; font-family: Courier, Courier New, Verdana, Arial; margin: 0 auto 0 auto; padding: 2px;}

Link to comment
Share on other sites

I get the same in phpBB, the line breaks don't work so I have to copy them over but I think that's because of how you save the file (like UTF-8, ASCI and those others)

Link to comment
Share on other sites

Notepad works great with Windows-style text, the Windows line endings and everything. For everything else, it doesn't work so great. That's why I use ConTEXT for everything involving text, if I paste something into Notepad and it looks butchered, sure enough I just open ConTEXT, paste the same thing and it comes out fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...