Un-Minimizing Attributes Written With PHP In TinyMCE

c-siems's Avatar


02 Aug, 2011 01:52 PM

Let me know if there is a better way to do this or a configuration I can use.
I think this is a "feature" of HH implementation of TinyMCE, but I noticed that the editor would "correct" my attributes when I wrote them properly in an PHP echo statement.

echo "<option value=\"$abc\" selected=\"selected\">$abc</option>\n";

would save as

echo "<option value=\"$abc\" selected="selected">$abc</option>\n";

which of course breaks PHP. No matter how I tried to trick it into using escaped quotes it always changed back to unescaped.
My solution was to use single quotes and concatenate the variables into the string:

  echo '    <option value="'.$abc.'" selected="selected">'.$abc.'</option>'."\n";
  1. 1 Posted by c-siems on 22 Sep, 2011 06:09 PM

    c-siems's Avatar

    I'll chalk this up to a feature of TinyMCE. The problem is we've have 100's of lines of PHP code that use minimized attributes. Having to rewrite them in this goofy form is going to painful.

  2. c-siems closed this discussion on 22 Sep, 2011 06:10 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac