Jump to content

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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...