Copied to clipboard

Flag this post as spam?

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


  • Jonas Horsner 14 posts 37 karma points
    Jan 22, 2012 @ 22:37
    Jonas Horsner
    0

    TinyMCE adds two brs after every p

    Hi

    I have a rather annoying problem. Every time I publish or preview the content from an Rich Text Editor(TinyMCE) it adds two <br /> tags after every <p> section. And I can't seem to make it stop, I've tried all the TinyMCE configurations I could find on TinyMCEs developer page. Everything looks fine in editor mode, and also in the html in editor mode.

    I am testing this in IE9, but have also tried in Chrome, with the same result.

    Has anyone encounted the same problem, and know how to fix it?

    On an sidenote:

    When I add these to the TinyMCE configuration - which makes the enter key add an <br> instead of an <p> tag.

    <config key="force_p_newlines">false</config>
    <config key="force_br_newlines">true</config>
    <config key="forced_root_block">false</config>
    When these are added to the configuration, IE9 won't jump to next line in the editor, unless I press a key. This is working in Chrome, which jumps to the next line, when hitting enter.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 23, 2012 @ 06:45
    Jeroen Breuer
    0

    Very strange. When you're in the RTE do you press enter when going to a new line or shift-enter? The last one will generate a <br/>.

    Jeroen

  • Jonas Horsner 14 posts 37 karma points
    Jan 23, 2012 @ 07:45
    Jonas Horsner
    0

    Hi,

    It doesn't matter which I press, the result is the same.. Or almost, it seems that the output is _always_ two <br> tags.

    1: If i use 'enter', and adds an <p> tag, it adds two <br> tags to the output.
    2: If i use 'shift+enter', and adds an <br> tag, it only adds one extra <br> tag to the out.

    Still everything looks fine the editor mode, and in html mode inside the editor, there are no <br> tags between the <p> tags, these are only added on the output. And if I reload the editor, they are still not there in editor mode, so they aren't stacking either.

  • Paul Marden 235 posts 338 karma points MVP 2x c-trib
    Oct 23, 2013 @ 15:41
    Paul Marden
    0

    I know this is old, but one of my team came across a very similar problem.  In the end it was caused by how the field was being output on the page.

    The pagefield was being inserted as <umbraco:Item field="content" stripParagraph="true" convertLineBreaks="true" runat="server" /> whereas what it needed to be inserted as was <umbraco:Item field="content" runat="server" />.

  • David Armitage 508 posts 2078 karma points
    Aug 24, 2017 @ 05:14
    David Armitage
    0

    Hi,

    Did you ever get this resolved? I am having the same issue.

    If I copy and paste plain text out of notepad into the RTE instead of separating the paragraphs with

    it separates them with

    .

    I tried all the config settings as other posts suggest and no effect

  • David Armitage 508 posts 2078 karma points
    Aug 24, 2017 @ 05:35
    David Armitage
    0

    Hi,

    I finally figured this out with a little help from another post I found. Well for Umbraco 7.6 which I am guessing is different from when this post was initially created.

    https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/54785-Paste-from-word-help-needed

    Here is the new setup for the config/tinyMceConfig.config file which works for me. It also cleans up the nasty html formatting when copy and pasting from Microsoft Word.

    <customConfig>
        <!--    <config key="myKey">mySetting</config>-->
        <config key="entity_encoding">raw</config>
        <config key="paste_as_text">true</config>
        <config key="paste_text_sticky">true</config>
        <config key="paste_text_sticky_default">true</config>
        <config key="codemirror">
          {
          "indentOnInit": false,
          "path": "../../../../lib/codemirror",
          "config": {
          },
          "jsFiles": [
          ],
          "cssFiles": [
          ]
          }
        </config>
      </customConfig>
    
Please Sign in or register to post replies

Write your reply to:

Draft