Skip to:

Allowing multiple line breaks in posts?

  • timsilva_


    I am migrating a forum database from the latest version of SMF to the latest version of bbPress. In SMF, many posts had multiple line-breaks in between sentences, paragraphs, images, videos, etc. It appears that WordPress, and bbPress, strip out multiple line breaks and limit them to a single line break (probably to prevent people from creating giant vertical gaps for no reason that other users have to scroll through). The way that bbPress deals with line-breaks from the SMF database migration was not very clean. It was mostly just random blocks of text and sentences without line breaks in between paragraphs that existed in SMF. There were PRE tags added in sometimes, and seemingly inconsistent P tags as well. BR tags appear to have been converted into empty TT tags. I was able to correct some of these formatting issues by tweaking lots of CSS (and a little JavaScript) in the default bbPress template. At the same time, I have also tested how line-breaks work separate from the migrated database and it appears that this maximum-of-one-line-break philosophy is on purpose. I see where that’s coming from, but I want to allow it anyways.

    I have read of methods where admins (and/or other users) can manually type in br tags as html with non-breaking spaces in between them as a hacky method of moving down three or four lines for whatever reason. I don’t want to have to train users how to do something that should be as simple as press enter like in any text editor.

    How can I simply achieve this in bbPress’s default comment forms? I don’t want users to have to type in…

    <br />&nbsp<br />

    …when they can simply just press enter twice in the textarea input.

Viewing 3 replies - 1 through 3 (of 3 total)

  • timsilva_


    Also, I have read many posts like this ( ), but I am looking for a more permanent solution for all users if its out there.



    That is a really old topic that used bbPress v1 standalone, which is entirely different software than what you have now. So I would recommend not using any code from topics about 3 or more years old.

    You may need to install a Find and Replace plugin to remove the tt tags, or just change back to break tags.

    To add mutiple line breaks you may need to read this, maybe install the mentioned plugin, and maybe also active TinyMCE in bbPress using the bbPress Enable TinyMCE plugin.



    Thanks for all the info Rob! I didn’t know about the shift+enter trick. I was hoping to find a way to avoid enabling TinyMCE for bbPress, but maybe it’s the best path to what I’m looking for.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar