Jump to:

22976 Posts in 11493 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Non-breaking spaces in editor

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 814 Views
  • redactuk
    Avatar
    Community Member
    115 Posts

    Non-breaking spaces in editor Link to this post

    I'm using the latest version 2.3.2 and I'm sure this has only started happening, but when I edit content via the admin area I keep getting lots of non-breaking spaces included. It doesn't seem to happen as you type a sentence to start with, but if you later go back in and edit it that's when it seems to be happening. I first noticed when some sentences were no wrapping on site pages themselves as I would expect them to, and then when viewing HTML for a content area realised that this was due to lots of non-breakign spaces that seemed to have been added as I edited the content. Maybe i'm being thick here but is this something I can control maybe via some editor settings?

    thanks

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Non-breaking spaces in editor Link to this post

    I'm having the same issue, but with the javascript I add.

    I have included the code in the LeftAndMain.php file to include javascript. My html stays fine, but the javascript added to the page keeps seporating - I think maybe on saving, closing the editor window.

    var x = 1
    var z = 2

    ----

    var x = 1

    var z = 2

    ---- later...

    var x = 1

    (space)
    (space)
    (space)
    (space)
    (space)

    var z = 2

    Any ideas to fix this issue?
    Thank you,
    Steve

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Non-breaking spaces in editor Link to this post

    I've had this happen and I blamed our frienemy TinyMCE coupled with the HTMLText the encodes/decodes text. I wasn't able to fix it without something hacky like onBeforeWrite() changes. Although perhaps this TinyMCE setting would help?

    http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/remove_trailing_nbsp

    You can change settings with:
    http://doc.silverstripe.org/doku.php?id=htmleditorconfig

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Non-breaking spaces in editor Link to this post

    Thank you.

    I tried some of the things mentioned here http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/remove_trailing_nbsp , but nothing seemed to change.

    This is mostly over my head. I really want to find a way to add a script like a paypal button script or other script without having to open the editor. Just click a button like adding an image, click on the screen where I want the form, etc. and add my code - click.

    I have seen some of this talked about in the TM forums but I will need someone at some point if I really need to implement this.

    Right now, either my connection is slow, of my script is causing the CMS to really crunch - just to open, or scroll.

    And of course still like to see the script stop adding spaces.

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Non-breaking spaces in editor Link to this post

    Another thought along these lines. Is there a way to add a <script> that includes my script? Like a php include in the page?

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Non-breaking spaces in editor Link to this post

    I am working on another work around. I did find that if I removed all returns in the code it is fine - just not very readable

    814 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.