Forum

Thread tagged as: Question

Textile Editor - stop forced paragraphs

Hi,

Is there any way to do this?

Thanks

Garth Holmes

Garth Holmes 1 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

What do you mean by "forced paragraphs"? Please show us an example of the output you are getting and what you are trying to achieve.

Textile adds its' own <p></p> tags even if there is no page breaks, i.e. carriage returns in the content.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's right. Textile will wrap blocks in paragraphs unless you have some other block type in use (like heading).

Interesting.

I am trying to allow arbitrary carriage returns without markup, is this in any way possible?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I don't understand what markup you are trying to achieve. If you use Textile or Markdown it will wrap paragraphs in the p element.

If you want truly arbitrary spacing then you need to give your user a way to add a class. You are trying to do something presentational and that is what CSS is for.

If you need help with that they show us an example of the output that you need.

Hi,

Obviously I want the best of both worlds but a simple field that understands when to enter a line break without adding a paragraph would be nice.

Perch prides itself on being so flexible but at its' most basic it does not achieve this.

It does understand when a line break is entered, for text within HTML that's when a paragraph starts and ends...

What problem is the <p> tag causing? What do you want the what the end users sees to look like? You may be able to target the area the text is being added with CSS to style it to do what you want?

An example would help :)

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Perch can't do something other than what HTML does. We're just outputting HTML based on your templates. To style it you use CSS.

If you give us an example of the markup you are trying to achieve then we can explain how that would work. Until you give us that example we can't really help.

Simon Clay

Simon Clay 127 points

One way to do it would be not to declare Textile as the editor in your template and to declare html as false. Like this:

<perch:content id="text" type="textarea" label="Text"/>

Now you can add as many returns as you like, there will be no markup.