<br /> for gods sake
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.
Try putting in
<br class="blank" />instead of just
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.
Trying putting this in instead…
It might create too large a gap, but you could tweak that by playing with the css.
Tiny MCE advanced has a button that adds <br class=”spacer_” />
You can even do
<p> <br /></p>
This sort of tweaks can be handy to avoid widows when you have floated images in a post.
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!
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.
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.
<p clear=all> </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?
Ok, I found a workaround. Install the TinyMCE Valid Elements plugin, then add as valid div, with attribute style, and then you can add
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.
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.
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?
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
. It works! 🙂
This would be simple if the editor simply had a radio button setting to strip
or not to turn this function on and off.
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.
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.
- The topic ‘<br /> for gods sake’ is closed to new replies.