WordPress.org

Ready to get started?Download WordPress

Forums

[closed] <br /> for gods sake (18 posts)

  1. bodhidude
    Member
    Posted 4 years ago #

    For Gods sake please update the editor to stop removing line breaks when they have been intentionally coded in. I don't use the editor but my clients often do so its a major pain when I've coded needed line breaks and they go to do a minor edit with the editor and the friggin breaks are removed. Yeah yeah I know there are work arounds but there shouldn't need to be for something so simple.
    grrrrrrr

  2. Try putting in <br class="blank" /> instead of just <br />?

    As I understand it, the extra lines are stripped because of HTML/XHTML standards. While it makes me cry, spacing between paragraphs is one blank line, so any time you put more than that in, they get eaten. Same reason why my normal habit of double spacing between sentences doesn't show up on WP. Frustrating.

  3. DavePorter
    Member
    Posted 4 years ago #

    Trying putting this in instead...

    <p>&nbsp;</p>

    It might create too large a gap, but you could tweak that by playing with the css.

    HTH, Dave

  4. richarduk
    Member
    Posted 4 years ago #

    Tiny MCE advanced has a button that adds <br class="spacer_" />

  5. belg4mit
    Member
    Posted 4 years ago #

    You can even do <p>&nbsp;<br /></p>

    This sort of tweaks can be handy to avoid widows when you have floated images in a post.

  6. argraff
    Member
    Posted 4 years ago #

    None of the above are semantically correct. I don't want to add a class to every break, my clients don't know how to, and extraneous paragraph tags are annoying. I seriously hope WP fixes this!

  7. Eternal Sky Chaz
    Member
    Posted 4 years ago #

    Seriously! Why should we have to put in garbage code to make a simple thing like line breaks work the way they are intended to work.

    This is NUTS!!! Earlier versions of WP didn't do this, why did you ever start? it makes NO sense and makes simple formatting of text a major chore.

  8. rmano
    Member
    Posted 4 years ago #

    I tried all the above tests, as well as the one commented in http://codex.wordpress.org/Wrapping_Text_Around_Images.

    They all works, and they all are completely unuseful because as soon as you switch to visual editor, they are stripped out.

    Even a <p clear=all>&nbsp;</p> (it's not illegal, I think!) Is stripped out when switching to visual editing.

    So, a simple question: is there a working way to force a clear=all or similar behavior after using a left- or right- aligned image in wordpress, which is not stripped out by the visual editor?

    Thanks,

  9. rmano
    Member
    Posted 4 years ago #

    Ok, I found a workaround. Install the TinyMCE Valid Elements plugin, then add as valid div, with attribute style, and then you can add

    <div style="clear:both;"></div>

    without having it removed by the visual editor. It works but it is a sort-of-a-hack.

    I think that a solution like the one found in most LaTeX editor would be great: add to the tinyMCE a element, a box, where you can put whichever html or xhtml code you want, no check, no touch it... a sort of I-know-what-I-am-doing box.

  10. bodhidude
    Member
    Posted 4 years ago #

    Most of the workarounds don't work once a page/post is saved with the editor again. Not to mention that adding all this extra crap clutters things up, because we all want the cleanest code we can get right? This would not be an issue for me if I did not have clients who wanted to be able to use the editor to make minor changes to their pages which is part of why I build with wordpress. WordPress is great but there are a few things that could use some improvement and would go a long way in creating happier designers and users.

  11. SoItBegins
    Member
    Posted 4 years ago #

    I have a question. On the website I run, the visual editor is disabled. However, some attempts to use multiple line breaks in the code editor won't work (such as between blocks of text under certain circumstances), and then I (or whoever's editing) has to workaround and add blank lines and fiddle with it to get it to work properly.

    Anyone have any ideas what's going on, is it related to this problem, and what file do I have to hack to fix it?

  12. MissEffigy
    Member
    Posted 3 years ago #

    Hi, I am not a coder but I have found a way that works, don't know why it does but it solved the line break problem for me. Just use capitals instead
    not
    . It works! :)

  13. MissEffigy
    Member
    Posted 3 years ago #

    oops I meant to put < BR >

  14. LazarusStone
    Member
    Posted 3 years ago #

    This would be simple if the editor simply had a radio button setting to strip
    or not to turn this function on and off.

  15. aljuk
    Member
    Posted 3 years ago #

    For what it's worth, I have a methodology that seems to be working for me:

    1. added to functions.php :
    remove_filter ('the_content', 'wpautop');
    2. installed "tinymce advanced" plugin, and enabled "stop removing the p and br tags..."
    3. use 'br class="blank" /' for rare occasions when I need two br tags in a row (to prevent a paragraph closing and wrecking a float, for example)

    Code stays consistent between editors.
    No hacks to core files.
    No validation issues.

  16. overclockwork
    Member
    Posted 3 years ago #

    There is no way this behavior can be justified. It interferes with the very principle I must rely on when producing or maintaining HTML markup. It does not take a software engineer to recognize that this must be the result of incompetence.

    It is not my intent that the HTML markup I write into the Field should be interpreted by a random function that changes the code. I want the browser of the user to interpret the code I write. It must not be tampered with the moment I save it - or when I switch to another view.

    Any modification of the markup entered into the field is but a disruption of intent. Because of this, wordpress cannot be used in any serious production.

  17. espressoguy
    Member
    Posted 3 years ago #

    I agree that there is no way this condition can be justified. It's a bug and a bad one. I've asked over in the TinyMCE forum and they say it's an issue with WordPress's implementation of TinyMCE, not a TinyMCE bug:

    http://tinymce.moxiecode.com/forum/viewtopic.php?pid=85153#p85153

  18. Okay, there is no need to cross post this in multiple topics. Now you're just spamming. You may not mean to, but you are.

Topic Closed

This topic has been closed to new replies.

About this Topic