Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Coldfusion cftexarea (richtext=true) alignment issue

Posted on 2007-11-29
2
Medium Priority
?
190 Views
Last Modified: 2008-09-16
When text is written inside a cftextarea and end-of-line is entered, and the source is viewed it appears within a <p> block. Due to subsequent processes it was neccessary for me to change fckconfig.js which configures this to make </br> the default function of the ENTER key.

However, the problem i get now is that <p> is ALSO submitted when the text is aligned. If i write some text, and align it in any way it is embedded within some <p> block, i.e:

<p align="justify">some text</p>

.. is there a way to configure, such as there was for the enter key, which tag should be used for alignment? .. ideally i would like to use <div align="justify"> since the subsequent process does not perform any formatting on <div> tags>>
0
Comment
Question by:paddycobbett
2 Comments
 
LVL 18

Accepted Solution

by:
Plucka earned 1500 total points
ID: 20379911
I would suggest that rather than modifying the fckconfig.js I would accept how it renders things, then afterwards alter the result using CF RegEx's.

Sounds like you have a problem on rendering the content, so just store it verbatim, and only change it to how you want it to work when you want to render it.

A simple non regex version of this might be
<cfset myContent = replace(myContent, "<p>", "<br />", "all") />
<cfset myContent = replace(myContent, "</p>, "<br /><br />, "all") />

Open in new window

0
 
LVL 1

Author Comment

by:paddycobbett
ID: 20384107
That's a reasonable work around thanks =)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month20 days, 23 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question