Results 1 to 11 of 11

Thread: [nbsp]??

  1. #1
    New user
    Join Date
    06-27-09.
    Posts
    26

    Default [nbsp]??

    Hi folks.

    I'm using the new TL version for the first time. I imported text from word into the editor and then removed all word formatting by clicking the eraser. What worked fine in previous versions now leaves code like "[nbsp]" or:

    [lt]!-- /* Font Definitions */ @font-face {font-family:"Monotype Corsiva"; panose-1:3 1 1 1 1 2 1 1 1 1; mso-font-charset:0; mso-generic-font-family:script; mso-font-pitch:variable; mso-font-signature:647 0 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-... etc.

    with the text I pasted and then has to be removed manually. I'm sure there's a simple setting that will prevent this from happening, but I can't find it. Can anyone give a tip? Thanks.

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: [nbsp]??

    As far as I can see the cause is not down to TYPOlight, but it's some function of TinyMCE. It substitutes an empty space with [nbsp] (for non breaking space), or > with [gt], for example.

    Maybe you can check on http://tinymce.moxiecode.com/ what they say. It wasn't in previous versions, so I guess that this has been added or activated in the latest version of TinyMCE that comes with TL.

    Let us know if you find out anything -- I also find this a bit annoying, as regular editors will not be able to make much sense of it.

  3. #3
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: [nbsp]??

    It is a TYPOlight feature though, so you probably won't get an answer at the TinyMCE website.

    There are a few allowed HTML entities in TYPOlight which have to be escaped to pass the XSS class. I find it very helpful to actually see those entities in TinyMCE now, because it keeps me from writing meaningless code like

    </p>
    or &nsbp;something.

    If you want to get rid of it, you can disable non-breaking spaces in the TinyMCE configuration file.

  4. #4
    New user
    Join Date
    07-11-09.
    Posts
    6

    Default Re: [nbsp]??

    If you want to get rid of it, you can disable non-breaking spaces in the TinyMCE configuration file.
    Hi,

    Since I am not a Javascript guru ops: could you please tell me how this can be done?
    Thanks a lot.

  5. #5
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: [nbsp]??

    Open file system/config/tinyMCE.php and change the following line

    Code:
    entities : "160,nbsp,60,lt,62,gt",
    to

    Code:
    entities : "60,lt,62,gt",

  6. #6
    New user
    Join Date
    07-11-09.
    Posts
    6

    Default Re: [nbsp]??

    Thanks for your prompt reply. I've edited the file but now, instead of [nbsp], it displays [&60].
    Any other suggestions to stop displaying these entities?

  7. #7
    New user
    Join Date
    06-27-09.
    Posts
    26

    Default Re: [nbsp]??

    found a solution, etravel? Leo?

  8. #8
    New user
    Join Date
    07-11-09.
    Posts
    6

    Default Re: [nbsp]??

    Hi Swissmiss,
    Unfortunately not and that [nbsp] entity is extremely annoying and does not help me increase my productivity.

  9. #9
    New user
    Join Date
    08-26-09.
    Posts
    10

    Default Re: [nbsp]??

    I answered that in the French forum : http://www.typolight.fr/forums/viewtopic.php?id=668

    Open file "system/config/tinyMCE.php" and add the line :

    Code:
    entity_encoding : "numeric",
    above the line

    Code:
    entities : "160,nbsp,60,lt,62,gt",

  10. #10
    New user
    Join Date
    07-11-09.
    Posts
    6

    Default Re: [nbsp]??

    Hi all-maps-welcome,
    Please try to replace the famous line with this one:
    entities : "60, lt, 62, gt", but note that
    you must insert a space after each comma, otherwise it will not work.
    This line solved my problem. In fact the solution offered by Leo was correct from the first moment, but
    that space after the commas must be specified also. I shall write this in the French forum also.
    Hope it helps.

    Regards,

    Etravel

  11. #11
    New user
    Join Date
    08-26-09.
    Posts
    10

    Default Re: [nbsp]??

    Hi etravel,

    I think both solutions work.

    1st solution : non-breaking spaces aren't encoded as entities => thus no [nbsp]
    2nd solution : non-breaking spaces are encoded as numeric entities (&#160; instead of ) => thus no [nbsp]

    But even if we use entity_encoding : "numeric", > and < are encoded as name entities and not numeric entities. I don't get why but ... whatever

    Quote Originally Posted by etravel
    note that you must insert a space after each comma, otherwise it will not work.
    It tried and it seems to work without space too...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •