WordPress.org

Support

Support » How-To and Troubleshooting » Turn off BR filter…

Turn off BR filter…

  • In an attempt to add new hacks to my website, rather the directions for implementing them, I’m relying heavily on the PRE tag and all that entails. The problem I’ve run into when handling whitespace, is that WordPress insists on adding BR’s after every line, which when using whitespace set to PRE, adds an additional break line that I don’t really want.
    Does anyone know of a method (or a hack) that turns off the BR’s for a time? A perfect example of what is happening can be found here: http://www.blindmuse.com/archive/2004/03/31/group-archives-by-year/
    Note the extra line breaks between lines, which I do not want. The reason I’m using white-space: pre is that it keeps the formatting for tabs between functions and what not. So, this is my cry, hear it someone 🙂

Viewing 15 replies - 1 through 15 (of 44 total)
  • OtherMichael
    Member

    @othermichael

    I have no answer to the added break tags, either. I could have sworn I saw one once, though. :::sigh::: Why the heck would it add the stupid things, anyway? If I wanted WYSIWYG I ask for WYSIWYG….

    Mark (podz)
    Support Maven

    @podz

    “This allows you to add custom fields to a post to disable auto-formatting and/or auto-smart-quote conversion. Latest Release: Version 1.0, 2004-05-21.”
    http://www.alexking.org/software/wordpress/1.2/wp-unformatted.zip
    Any good ?

    OtherMichael
    Member

    @othermichael

    Whoah. Why should I have to add something to WordPress to make it stop adding things nobody asked for?
    I mean, why would those break-tags be there, anyway? I’m formatting my posts correctly, everything is happy…I have extra spaces in them so I can read and parse it visually (becuase I ma not a browser). Almost every browser in the world ignores spaces and line breaks. So why does WP add them in? This is not a feature–it is an extremely annoying bug.
    Is there any more documentation on that plug-in? His one-sentence description doesn’t exactly do it for me.

    OtherMichael
    Member

    @othermichael

    Gosh, I’m a whiner! Sorry.

    ElasticDog
    Member

    @elasticdog

    There are two plugins that do it conditionally, which can be controlled by adding meta data to your entry…I also wrote a plugin, which hasn’t been put up anywhere yet, that just turns off the auto-formatting by for all entries, with no control since I like to control my output…I figure if Ibreak it, I’ll fix it 🙂
    If you’re interested in the code, I can put it up somewhere real quick.

    OtherMichael
    Member

    @othermichael

    Maybe this thread is germane?

    OtherMichael
    Member

    @othermichael

    How sad that Blogger actually allows you publish non-screwed HTML, but WordPress makes you install a plugin to stop it from screwing it up.

    Moderator Matt Mullenweg
    Keymaster

    @matt

    Thanks for your opinion. If you don’t want autop to run on your code, just use remove_filter. If you think it’s a bug in the processing, please post the code it messed up here:
    http://wiki.wordpress.org/?pagename=autop-bugs

    OtherMichael
    Member

    @othermichael

    Heh. Thank you for your restrained diplomacy. I’ve been posting far to much about this issue, only it was really getting under my skin today.
    I took the advice listed in another thread and In includes/functions-formatting.php changed $br = 1 to $br = 0 in the autop function.
    Still, I hope to see a check-box or some-such under Options in the future.

    I don’t. It’s a feature that, quite frankly, very few people care about. If we were to include an option for every thing in WP that every single minority wanted – we’d have such a complicated options page that new users would be scared off.
    Sometimes you have to think whether the feature you’re asking for is really for the common good, or your own good.

    echo Brak

    I completely agree with OtherMichael. We should have the ability to turn off this automatic formatting without installing plugins, adding extra fields, or altering the code. This should be part of the core distribution. It would be an extremely easy feature to include, and it won’t scare off timid users — that is who the “Simple controls” setting is for. The “Advanced controls” only have 3 or 4 minor additional features, and this is a perfectly logical 5th. It can be deselected by default — no one gets hurt 😉

    I understand Brak’s argument against adding complicated features for the few, but I’m willing to bet we aren’t as few you think; but even if we are a minority, we are an important minority of advanced users capable of forming our own html and don’t want our tool to fight against us every step of the way.

    A feature shouldn’t have to be requested and used by 51% of the user base to be included, especially if it’s tucked into the Advanced tab where the average user fully expects to be confused by some of the options anyway. After all, tell me honestly, how many people need “Geo Tracking Features” in the default install, now that should be plugin ; )

    The main reason for my reply is to be counted in this few. Others reading this post who agree with OtherMichael and me should also chime in.

    Moderator James Huff
    Support Team Rep.

    @macmanx

    Login to your admin interface, go to Options/Writing, uncheck “WordPress should correct invalidly nested XHTML automatically”.

    macmanx: That doesn’t help, I still get dangling p tags peppered throughout my markup.

    I seem to remember something about having block level elements inside list items possibly causing this problem, I’ll look into it.

    When I comment out the wpautop filter in the code it works ok, and I can deal with it, but it took me a ridiculous amount of time to locate this bug and fix it with a hack.

    Moderator Matt Mullenweg
    Keymaster

    @matt

    remove_filter('the_content', 'wpautop');

Viewing 15 replies - 1 through 15 (of 44 total)
  • The topic ‘Turn off BR filter…’ is closed to new replies.