Jump to content

stop tinymce from removing entities


wishbone
 Share

Recommended Posts

I try to prevent tinymce from removing entities. I put

entity_encoding: 'named', entities: 'nbsp'

into the Advanced tinymce settings section of the text field - doesn't work.

I know you want to prevend users to break up the thing - but I want to be able when using the system myself, to do what I want ...

Link to comment
Share on other sites

TinyMCE can be a bear sometimes. I don't know how to accomplish what you are trying to do, and most likely this is a question more for the TinyMCE forums than here. But the first thing I would try is to open the code editor, insert an  , close the code editor, then open it again. Is the   still there, or did TinyMCE get rid of it? This might point to whether you are dealing with a filter or not. Or, does the   only disappear after saving the page? 

  • Like 1
Link to comment
Share on other sites

Okay it sounds like it must be part of TinyMCE's validation rules. In that case it's just a matter of finding what configuration directive needs to be supplied (or removed from) TinyMCE in order to change that behavior. I am guessing you will be able to find it in their documentation, but if you can't, you could always make a [[nbsp]] Hanna code too. :) 

  • Like 1
Link to comment
Share on other sites

Hanna code is really nice... but I can't bring it to work. It works when "saved and tested" on the module page - but if inserted in a textarea, the output is [[nbsp]]...

Anyway, I really would like to prevend tinymce to do things with my code. I have been searching extensive and came up with the above...

modX tinymce settings didn't change any of the code...

Link to comment
Share on other sites

  On 8/9/2013 at 9:19 AM, wishbone said:

Hanna code is really nice... but I can't bring it to work. It works when "saved and tested" on the module page - but if inserted in a textarea, the output is [[nbsp]]....

Seems like you did not add Hanna Code Text Formatter to that particular textarea field? Do this under DETAILS when editing the field :)

  • Like 1
Link to comment
Share on other sites

thx! my fault... point 5 in the install instructions...

I also fixed my first suggestion above; some sudden impulse made me try

entity_encoding: 'named', entities: ' '

and that works!!

Nevertheless, we had some nice tinymce settings in modX :D which I'd like to set.

- Make tinymce not to clean any output

- paste plain text button (well, yes, that's another thread...)

The first is a common problem, I found a joomla solution (with a plugin to edit the config):

Code Cleanup on Startup: Off
Code cleanup on save: Never

http://www.mysysadmintips.com/other/web/158-joomla-tinymce-editor-removes-non-braking-spaces-on-saving

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...