|
How to stop FCK Editor wrapping your content with 'P' tags |
Whilst testing a website for WCAG 2 Accessibility compliance I noticed that all my dynamic content from a database was wrapped in the HTML 'P' element.
The functionality that put the content into the database was a rich text area using the inbuilt FCK Editor. This article deals with how to stop FCK editor wrapping your content in undesirable tags.
This variable to control what FCK editor wraps your content in is called the 'EnterMode'. This is variable read from the 'fckconfig.js' file, which is located in the 'webroot\CFIDE\scripts\ajax\FCKeditor\' directory. It basically specifies whether to wrap your text in a 'p', 'div' or 'br' tag. In my case I am outputting a header element, and FCK Editor is adding a 'P' tag inside the 'H1', which is not valid html.
Find the line that looks like this in your fckconfig.js file.
Change the value to 'br' and refresh your browser cache. Any new content submitted through the rich text area will not be surrounded in 'P' tags.
http://www.ipergel.it/replica-orologi.html
http://atticosulmare.it/cms-images/replica-orologi...