WordPress.org

Ready to get started?Download WordPress

Ideas

Let us force a line break

  1. EvilE
    Member

    12345

    We need a solution. This is ridiculous!!!

    Posted: 6 years ago #
  2. neilyalowitz
    Member

    This really did a great job:

    Dean's FCKEditor For WordPress
    http://wordpress.org/extend/plugins/fckeditor-for-wordpress-plugin/

    I can't believe how disappointing the default WP visual editor is. Just awful.

    Posted: 6 years ago #
  3. bento
    Member

    The KCKEditor fixes the issue with the line-breaks!
    Thanks for the hin!

    Posted: 6 years ago #
  4. Andrew Ozz
    WordPress Dev

    To insert a BR tag in TinyMCE you press Left Shift + Enter (like in the more advanced text editors). That's it. It was mentioned several times here, but nobody seems to notice.

    This currently doesn't work in Safari, as this browser is not fully supported by TinyMCE 2 (best option is to use FF on windows, linux, mac, solaris, bsd, os2, etc.) but TinyMCE 3 that's coming to WordPress soon supports it nicely.

    Posted: 6 years ago #
  5. MattAlgren
    Member

    12345

    Azaozz, I tried what you suggested and WordPress gobbled up the breaks. (Unless you're talking about the plugin, which I haven't installed yet.)

    Posted: 6 years ago #
  6. aar0on
    Member

    Hold down Shift and hit Enter. Easy as pie. But I use the FCKEditor, so I don't know if that works with the standard editor.

    Posted: 6 years ago #
  7. MattAlgren
    Member

    12345

    That doesn't work, aar0on.

    I tried the FCKEditor and the TinyMCE 2.0 and didn't like either of them. TinyMCE was still stripping the line breaks (even after doing what was suggested above), and both are somewhat clumsy (to me), so I went looking for another solution. I found the TextControl plugin (link below) which does the trick without trying to insert its own editor.

    Note that this is only a workable solution for future posts. If you have a new blog, awesome. If you have one with old posts, you'll have to set it to the WordPress default and change the processor in each post individually. A pain in the neck, but at least I can force a line break now.

    Link to the plugin:
    http://dev.wp-plugins.org/wiki/TextControl

    Hopefully this fault in WordPress's programming will be addressed in the next version. It's a real shame that we have to search for workarounds to do something so incredibly basic.

    Posted: 6 years ago #
  8. ckgni
    Member

    This problem was driving me nuts too. Unable to insert any line breaks anywhere. My posts where looking very gibberish without line breaks.

    I was so frustrated, that I was ready to remove WordPress from my site and start looking for other blogging software.

    But finally, I solved it myself.

    I opened wp-includes/post-template.php

    I found function the_content

    and just *before*

    echo $content;

    I added this.

    Edit: I uploaded the code here, because WordPress cannot display it correctly:

    http://www.ngitech.org/solution.txt

    I wonder, it was so difficult for the WordPress developers to add this single line of PHP code, to allow us to enter line breaks in our posts? Even someone with very few PHP knowledge knows how to do this.

    Posted: 6 years ago #
  9. whas27
    Member

    Hey guys...

    this issue initially got me into looking under the hood of WordPress... several portions of the fix have already been pointed out:

    1) Use FCKE editor plugin
    2) Comment out ALL of "wpautop" function in /wp-includes/formatting.php except the "return $pee;" line

    [BTW, in response to oscarf's concerns, I have not seen any adverse effects of this when editing in FCKE. In fact, I only do switches to HTML source every once in a while now because it works so well, while leaving my custom code alone due to the wpautop fix. Now I would not recommend opening up a full version of FCKE to the public for editing, if that were necessary, do a separate install with an FCKE where you disable the "Source" button in the editor config file.]

    A wonderful side-effect of this is that WP runs faster because this saves dozens of precessing intensive regular expression (regex) matching/replacing operations. wpautop when left on has about 20 of these that it runs PER POST! So on your index page with e.g. ten posts it could be 200 regex calls!

    Also, there really is no reason for this big-brotherly review of people's HTML for some supposed compliance (especially if it has unforeseen bugs like these from not fully considering the effects of some of the "greedy" regex operators). If someone doesn't do HTML and uses the FCKE, etc. editor, they won't really be inserting custom HTML anyway so it's all good... if they do know custom HTML, then let them make all of the mistakes they want... they'll know soon enough...

    In my mind, the wpauto function should be ditched in next WP revision... it's a bug/resource hog! Let them know.

    Best - Alex

    Posted: 6 years ago #
  10. bwithrow
    Member

    ckgni's solution worked for me.

    Update: Though I still can't add single line breaks, just the usual double line. So if I do "shift+enter", I only get the full break.

    Posted: 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    426 Votes
  • Status

    Sorry, not right now