Let us force a line break

  1. mfmh

    I found the solution for line break.

    first. Open the file.

    line 243:
    content = content.replace(new RegExp('<p>(\\s| )*</p>', 'mg'), '');


    // content = content.replace(new RegExp('<p>(\\s| )*</p>', 'mg'), '');

    line 297-300:
    content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
    content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
    content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
    content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');


    //content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
    //content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
    //content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
    //content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');

    line 572-588:
    pee = pee + "\n\n";
    pee = pee.replace(new RegExp('\\s*', 'gi'), "\n\n");
    pee = pee.replace(new RegExp('(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\\s*
    ', 'gi'), "$1");
    pee = pee.replace(new RegExp('(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');


    //pee = pee + "\n\n";
    //pee = pee.replace(new RegExp('\\s*', 'gi'), "\n\n");
    //pee = pee.replace(new RegExp('(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\\s*
    ', 'gi'), "$1");
    //pee = pee.replace(new RegExp('(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');

    But some problem left yet.
    Good luck to you.

    Posted: 12 years ago #

  2. Inactive

    The one bit of code it doesn't seem to muck with is & nbsp;


    & nbsp;
    & nbsp;
    & nbsp;

    forces a line break every time. (without the space between & and nbsp;).

    Best I can do. Hope it helps.

    Posted: 12 years ago #
  3. Miral

    This really bugs me. Trying to enter code in the visual editor in WP2.2 (within
    <pre> tags) was a raving nightmare. Nearly every time I switched between the visual and code tabs it doubled the linebreaks -- and when it didn't do that, it removed them entirely. Until this is sorted out the visual editor is getting avoided like the plague it is.

    Posted: 12 years ago #

  4. Inactive

    I'm new to WordPress but not to HTML. Whenever I put a «br» tag in my entry... it' changes to «br /». I'm going effing crazy! Why can't I put in line breaks?! Arrrghgghh! PLEASE can somebody fix this?

    Posted: 12 years ago #
  5. Harvey

    The most annoying thing about this, is that if you use pcpoets fix, the

    & nbsp;
    & nbsp;
    & nbsp;

    The next time you go into the post to edit it, all of that code has been stripped and you must enter it again!

    This is most annoying.

    Posted: 12 years ago #

  6. Inactive

    Just chiming in...very annoying that code doesn't show all the code and that the WYSIWYG doesn't give me what I see. :P

    Posted: 12 years ago #
  7. Andreamly

    wow - I tried everything - this was ruining my business since I would spend 5 hours trying to manipulate every stupid blog post... Just after reading this, used the

    & nbsp;'s as suggested above a few times... works like a charm!

    Best of luck !

    Posted: 12 years ago #

  8. Inactive

    Ok. So I think I've found a solution to our problem that works everytime when formatting and making line breaks in any text. Finally I am seeing separate paragraphs... and in a short moment, you should be too...

    The great thing about this, is that the code does not disappear or get removed by the WordPress coding. It remains there even if you have to return to edit your text...


    First, you'll need to install the "Text Control" Plugin.. You can find this here:

    Once you have downloaded and installed this plugin, you will have to "Activate" it..

    Navigate to your "Options" Screen via your Admin Control Panel in your WordPress...

    Choose the "Text Control Config" Tab.

    Then, in the "Posts & Excerpts" area, change the first pull-down menu to "No Formatting"

    Then the second pull-down menu, to "No Character Encoding"

    Click on the button labelled "Change Default Post/Excerpt Formatting" right next to it to update your settings...

    That's it. You've done the hard part....

    Now you will simply use the following...

    <br _extended="true" />

    to create your line breaks in your post's text, or any page for that matter...



    Should be smooth sailing from there until WordPress finds a way to make this easier for us...

    Hope this helps everyone..

    Posted: 12 years ago #
  9. webwide

    Wow - plugins required to fix known issues! This is the craziest thing WP has ever done. What a pain in the ass.

    Look, just because you guys are currently the king of the hill doesn't mean that problems like this won't cause people to start Googling for your competitors. All because of break and paragraph tags? Is that really worth it?


    Posted: 12 years ago #
  10. FlameOn

    I've tried the <br _extended="true" /> code and procedure, but it wasn't a go. Where exactly do I put it? I probably sound moronic, but apparently we're not dealing with simple HTML, where inserting a usual break is as easy as 123. I tried putting in between texts, texts inside of it, a couple of methods and no go. Can anyone be more specific on where to put the code, please?

    Posted: 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    426 Votes
  • Status

    Sorry, not right now