Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-19 19:22:27

timstr
New Member
Registered: 2006-12-14
Posts: 6

[textile] Converting multiple line breaks to paragraphs

I have been looking for a way to convert multiple line breaks in a user’s input into paragraphs (<p>…</p>), while converting single line breaks to a simple <br />. I have found several ways, but most appear to be flawed and do not seem to work as well as Textile’s magic.

Could someone who’s familiar with the Textile class point me to the code snippet that handles line break conversions, so I can have a look and (hopefully) learn?

Last edited by timstr (2007-12-19 19:22:51)

Offline

#2 2007-12-19 21:33:44

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [textile] Converting multiple line breaks to paragraphs

I’m not 100% familiar with textile code, but I after a quick look I think you’ll find what you need in one of these functions:
cleanWhiteSpace -> block (or blockLite) -> doPBr

Offline

Board footer

Powered by FluxBB