Help - Search - Members - Calendar
Full Version: converting paragraph breaks - sometimes
Movable Type Community Forum > Additional Resources > Tips and Tricks
btrott
There isn't a very easy hack to change this behavior in the MT code. But there is a way to stop it--instead of putting a line break or two before the <blockquote> (or the <ul> or <ol>), put those tags on the same line as your text, directly after the end of the text. Then you won't get any breaks inserted by MT.
gleuschk
Thanks, Ben and Brenna.  I suppose you can't expect to escape hands-on coding completely, when you're also interested in compliance.
MatrixRaven
Is there any way to get RID of those paragraph tags that MT inserts for you?  I'd like to be able to enter them myself, or use the div tag to center text or images when I post them, but if I do that, then my page won't properly validate as XHMTL 1.0 transitional because MT automatically starts off my entries with paragraph tags and also inserts one after every line break (when I hit return a couple of times and start a new line).  And this is AFTER I turned that option off in the blog configuration.  I've checked my index.shtml template, and the tags aren't in there.  I've also checked my stylesheet, and the tags aren't in there.

Any hints, please, before I become bald from pulling my hair out? wink.gif
bmk
Exactly what girlie said.  If you uncheck the option in blog config and rebuild, the <p>'s shouldn't be there.

Brenna
gleuschk
I've read many threads asking for ways to modify MT's treatment of linebreaks and paragraph breaks, but nothing quite like what I'm hoping for.

I'm all over MT's XHTML-compliant code - it makes me oh so happy.  However, I use [blockquote] fairly extensively, and it's causing all kinds of problems, especially when there are para. breaks within the quoted text.  Is there any way to tell MT (perhaps by hacking Util.pm - I'm not afraid) to stop looking for paragraphs when it sees a [blockquote], and not to start again till it sees a [/blockquote]?

I can think of other tags it would be nice to ignore: [ol], [ul].

Many thanks,
Graham
leuschke.org
bmk
I use blockquote a lot on my site, and you definitely want to continue the post on the same line, as Ben mentioned.  Also, adding a </p> and <p> around the blockquote works nicely and keeps the XHTML valid.  You don't have to write the first <p> and the last </p>, because MT adds this in for you.  Example:

CODE
This is the beginning of the post.</p> <blockquote>This is where the blockquote is.</blockquote><p>And this is the end of the post.

HTH!
Brenna
wcowley
I ran into the same problem a little while back with divs that I'm using in place of blockquotes.  The para tags being inserted around the div were breaking NS4's rendering of the style for the rest of the page.  Today I added a line to  html_text_transform in Util.pm to clear it up. I'm a Perl newbie, so this may not be the best solution, but it seems to be working:

CODE
     <snip>
     # next line is new
     $p =~ s/(<div .*?>|<blockquote>|<\/div>|<\/blockquote>)\r?\n?/<\/p>\n$1\n<p>/g;

       $p = "<p>$p</p>";
       </snip>
girlie
The only thing I can think of is, are you a) SURE you unchecked that option in blog config (there is one option for entries, and one for comments) and b) did you rebuild your files after saving the configuration changes??
MatrixRaven
*grin* Hmm.  Is this the time when I hang my head and sheepishly walk away in shame?  Until it was brought to my attention that I should probably look at my blog configuration closer, I had been scrolling down all the way and looking at comments configuration.

So, I'll try to be a big girl here and say thanks, and not look so red in the face.  I really should be doing this when it's not 3am and I am more awake.

Thank you very much for pointing out my error *puts paper bag over head*
bmk
*takes paper bag off MatrixRaven's head*

It's all right babe..... I know how you feel. biggrin.gif

Thanks for comin' back and posting that everything's ok with that now.  Weeeeeeeeeeee!

Brenna
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-2010 Invision Power Services, Inc.