user-pic

Double-breaks to Paragraphs

Vote 0 Votes

Sorry for the flood of questions, but... you know.

My posts come out with double-breaks (<br /><br />) between each paragraph, instead of using actual paragraph tags.

Does anyone have a fix for this? I'd try using regex_replace but there may be DIV tags in the mix which shouldn't be wrapped with paragraphs, and I'm not feeling prepared to write a really complex regex pattern right now. :-P

I searched the plugins but didn't spot anything particular to this. If Assetylene or Custom Asset plugins affect this... the first doesn't have documentation & I turned off the second so it doesn't get into a fight with Assetylene. :-)

My editors are editing posts using the Rich Text format, if that makes a difference.

Thanks for any suggestions!

Reported on Movable Type 4.2

3 Replies

| Add a Reply
  • OK, I had yet another really stupid idea for what is probably a hideously scary hack. This is not the answer I'm looking for, so please give me better answers than this.

    I already wrapped my body content in a div (class= body_content) so I could control the space between it and the "read-more" link.

    So... replace every double-break with a close-div and an open-div for more body-content. Effectively wrap every paragraph of body content within a div. Better than wrapping it in paragraph tags (if there's an internal div). But probably dangerous. I'm depending on my limited pool of users not entering any double-breaks in odd places. :-(

    This is my code in case anyone wants to do something similarly dumb.

    <div class="body">
    	<mt:if tag="EntryBody">
    		<div class="body_content">
    			<mt:EntryBody filter="html" regex_replace="/<br \/><br \/>/g","</div>\r\r<div class=\"body_content\">" /><mt:ignore>
    					// That pattern wraps every paragraph in a classed div. Hack!
    				</mt:ignore>
    		</div>
    	</mt:if>
    .
    .
    .
    
  • Have you tried any of the other editors? I think it is a feature of the RTE.

    • It's because of the default RTE, but it's also dependent upon which browser is being used. I believe that IE, for example, does return separate paragraph tags(though I could have that backwards).

      This is in part because of the way the built-in RTE works. If it's a problem for you, I'd suggest using one of the plugins that replaces it.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012