Help - Search - Members - Calendar
Full Version: getting rid of line breaks
Movable Type Community Forum > Additional Resources > Tips and Tricks
mutedgirl
I was messing with Util.pm and I found where the line breaks are added in:

CODE
sub html_text_transform {
   my $str = shift;
   $str ||= '';

   my @paras = split /\r?\n\r?\n/, $str;
   for my $p (@paras) {
       $p =~ s!\r?\n!<br />\n!g;
       $p = "<p>$p</p>";
   }
   join "\n\n", @paras;
}


I simply changed this:

CODE
$p = "<p>$p</p>";


to this:

CODE
$p = "$p<br>";


And so far, I haven't noticed any major problems!  I'm able to have everything aligned right, no spaces between the title and the entry, and I can keep 'convert line breaks' on for the posts so I don't have to hand code everything in- plus I can use the smilies in the comments without having HUGE blank lines there smile.gif

Hope this helps anyone who might need it!  And I hope I don't notice any problems with it *crosses fingers*
mutedgirl
I've noticed only one thing so far- paragraphs in the entries are only separated by one line instead of 2- but if you just hit 'enter' twice, that should fix it smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.