Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve Hayter 3 posts 23 karma points
    Sep 23, 2011 @ 18:02
    Steve Hayter
    0

    Chrome, TinyMCE, and Line Breaks

    I just received a bug report this morning of users trying to paste text from plain text documents into the TinyMCE editor, but having all the line breaks removed. The users all seem to be using Google Chrome.

    I didn't believe it at first, but when I try it - they're right. If I have the following text in (for example) Notepad:

    This is a paragraph
    This is a paragraph
    This is a paragraph

    In Firefox and IE, the line breaks get inserted as expected:

    This is a paragraph
    <br/>
    This is a paragraph
    <br/>
    This is a paragraph

    But in Chrome, nothing. The lines just get appended to one another:

    This is a paragraphThis is a paragraphThis is a paragraph

    Trying this on the demo page of the TinyMCE website doesn't exhibit the same behaviour - so it must be something related to the version of TinyMCE used in Umbraco.

    Has anyone else experienced this issue? I've played around with the force_p_newlines, convert_newlines_to_brs properties, etc - to no avail.

    I want to think it's a Chrome bug, but it's working in the new version of TinyMCE so surely it can't be?

     

  • Steve Hayter 3 posts 23 karma points
    Sep 23, 2011 @ 18:03
    Steve Hayter
    0

    Incidentally, pasting from Word works fine - so it must be specific to plain text.

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Sep 23, 2011 @ 21:09
    Dan Diplo
    0

    I can confirm this - for some reason Chrome actually wraps the entire pasted text in a <pre> tag so you get this mark-up:

    <pre>This is a paragraph<br />This is a paragraph<br />This is a paragraph</pre>
  • Steve Hayter 3 posts 23 karma points
    Sep 25, 2011 @ 12:55
    Steve Hayter
    0

    Glad someone else has confirmed it - thanks Dan.

    But if you go to http://www.tinymce.com/tryit/full.php, it doesn't happen - so I don't think it's something to do with Chrome entirely. I think the version of TinyMCE in Umbraco does something which causes it to happen. So there must be a way around it.

    Anyone have any ideas?

  • David Conlisk 432 posts 1008 karma points
    Apr 26, 2012 @ 11:41
    David Conlisk
    0

    I've got the same issue. A simple workaround is to paste your plain text directly into the HTML view, then save and use the richtext editor to add paragraphs, etc. But not exactly ideal.

    Any tiny mce gurus aware of any settings we could use to sort this?

    Thanks,

    David

  • Grant Thomas 291 posts 324 karma points
    Apr 26, 2012 @ 12:51
    Grant Thomas
    0

    Hold on a second, how the devil are you getting it to use `br` breaks? Usually just rapes my content with 'empty' paragraphs (that aren't really actually empty, because, well, there's another fundamental flaw: it won't handle literally empty tags!), i.e. `<p>&nbsp;</p>`.

  • Denis 47 posts 68 karma points
    Oct 29, 2013 @ 11:48
    Denis
    0

    I have problems with Umbraco 6.1.6, and Google Chrome

    can't  create line break with shift+enter, it is created  span style = "line-height: 1.428571429;", not br

    with firefox br is normaly created

  • Bruno Olsen 75 posts 316 karma points
    Aug 26, 2014 @ 13:46
    Bruno Olsen
    0

    Having the same issue. In Firefox thing work fine, pasting from Notepad results in text wrapped in p-tag and using br-tags. In Chrome pasting from Notepad results in text wrapped in pre-tag and using br-tags. Other than disallowing pre-tags have anyone found a solution?

Please Sign in or register to post replies

Write your reply to:

Draft