Page 1 of 1

Clean up designmode....

Posted: Mon Jun 19, 2006 3:30 pm
by mr.morton
Hi'


I use a WYSIWYG editor for a textarea and it works pretty but the HTML it makes i can't use
An example of what it produces:
<span style="font-weight: bold;"> Bold <span style="font-style: italic;">test <span style="text-decoration: underline;">test</span></span><br /></span>

But i would really like it to have this format instead:
<b> Bold <i>test <u>test</u></i><br /></b>

Does anybody know how to parse it in PHP to fix this?

Kind regards
Morten

Posted: Mon Jun 19, 2006 3:38 pm
by feyd
regex and/or string parsing with some special nesting support tucked in. It's not fun.

Posted: Mon Jun 19, 2006 3:43 pm
by Benjamin
Most of the tags you want to use are depreciated. I would encourage you to find another solution.

well......

Posted: Mon Jun 19, 2006 5:48 pm
by mr.morton
The thing is the text entered in the editor will be displayed via flash, and it has a limited HTML support:
http://livedocs.macromedia.com/flash/mx ... 01040.html

Therefor I need the "old" tags.

Posted: Mon Jun 19, 2006 5:56 pm
by Christopher
Better might be to find all the unique styles (i.e. style="...") and build a stylesheet. Then replace all the style="..." properties with the appropriate class="stylexx" property.

Re: well......

Posted: Mon Jun 19, 2006 6:03 pm
by RobertGonzalez
mr.morton wrote:The thing is the text entered in the editor will be displayed via flash, and it has a limited HTML support:
http://livedocs.macromedia.com/flash/mx ... 01040.html

Therefor I need the "old" tags.
If the HTML support is limited now, imagine how bad it will be when the <b>, <i> and <u> tags are no longer supported at all? That is the direction of the HTML standard. In fact, <b> and <i> (or is it <u>) are already depricated. The recommendations are to use either <strong>, <em> or <span style="text-decoration: underline;">, I believe.