quickapps / cms

Modular CMS powered by CakePHP
GNU General Public License v3.0
164 stars 69 forks source link

TextField renders invalid HTML #170

Closed paulrwest closed 7 years ago

paulrwest commented 7 years ago

The Problem:

field/src/Template/Element/TextField/display.ctp

Surrounds the field with <p> tags then echos out the value of the text field

<p><?= TextToolbox::formatter($field); ?></p>

When using HTML text it results in invalid HTML due to the <p> tags wrapping around the fields HTML - the resulting HTML formatted like so:

<p><p>Hello World</p></p>

Which most browsers now fix the invalid HTML by auto closing and opening the surrounding tags:

<p></p><p>Hello World</p><p></p>

This results in too much padding around all Text fields when being displayed.

The Solution: Can you remove all <p> tags from this file and let TextToolbox deal with adding any tags needed?

Thanks in advance

botchris commented 7 years ago

sounds reasonable, i'll take a look :)