Barand Posted July 23, 2012 Share Posted July 23, 2012 Recently, whenever I copy code from a code or php box and paste into my IDE (or into the post reply box) it inserts several unwanted linefeeds between each line. Quote Link to comment https://forums.phpfreaks.com/topic/266118-unwanted-linefeeds/ Share on other sites More sharing options...
.josh Posted July 23, 2012 Share Posted July 23, 2012 Well we don't want them either, no takebacks! Quote Link to comment https://forums.phpfreaks.com/topic/266118-unwanted-linefeeds/#findComment-1363723 Share on other sites More sharing options...
PFMaBiSmAd Posted July 23, 2012 Share Posted July 23, 2012 The tag has always done that, but it is also dependent on what kind of new-line character(s) are in the original source. I think, but have not specifically tried to pin it down, that it is when a the new line is not exactly a \r\n pair, in that order. Whatever condition triggers this, each \t has a \r\n added to it and each existing new-line has a \r\n added to it. I'm not sure if there is some javascript on the page that is running when you select the code in the block or if this is occurring in the javascript in the form editor or when the code is posted and it is TIDY'ed up. One of the guru's suggested quoting the post and copy/pasting the code block out of it to get it without all the extra new-lines, which does work. (edit: perhaps php code is ran through a TIDY script when the post is displayed, but not when it is quoted.) Quote Link to comment https://forums.phpfreaks.com/topic/266118-unwanted-linefeeds/#findComment-1363729 Share on other sites More sharing options...
PFMaBiSmAd Posted July 23, 2012 Share Posted July 23, 2012 AFAIK, the tag is built into SMF and it doesn't have this problem, even with php code in the block, but the tag is an add-on. Might be time to find a different php code highlighter. Quote Link to comment https://forums.phpfreaks.com/topic/266118-unwanted-linefeeds/#findComment-1363744 Share on other sites More sharing options...
Philip Posted July 23, 2012 Share Posted July 23, 2012 PHP code highlighter uses the same code the code boxes does, at least since the upgrade. :-/ However, new forum software soon enough. Quote Link to comment https://forums.phpfreaks.com/topic/266118-unwanted-linefeeds/#findComment-1363752 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.