WordPress.org

Ready to get started?Download WordPress

Forums

fixing crazy <p>eeing (5 posts)

  1. spiceee
    Member
    Posted 10 years ago #

    so far i've hacked my brain to no avail. my beautiful xhtml 1.0 validation had gone to hell with crazy contructions such as

    s and even
      s (???)
      i've commented out the wautop (??) filter, to no avail, so i've come up with a hack and my blog is back to xhtml 1.0 heaven.
      so if you're also dealing with this, try this snipet on your hack file and it should pull the trick:

      function hack_fix_para ($str){
      $str = preg_replace ("#()<(table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>(</?p>)?#msi", "<$2>", $str);
      $str = preg_replace ("#(</?p>)?</(table|thead|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>()#msi", "</$2>", $str);
      return $str;
      }
      add_filter('the_content', 'hack_fix_para');

  2. carthik
    Member
    Posted 10 years ago #

    As always, could you please add that to http://wiki.wordpress.org please?

  3. TechGnome
    Moderator
    Posted 10 years ago #

    But what does it DO?
    TG

  4. spiceee
    Member
    Posted 10 years ago #

    just an update:
    i realized the crazy eeing was caused by the textile plugin i had activated.
    i don't know whether the plugin was generating invalid mark-up because i had it on even though i never use the textile expressions or it just does go around crazy peeing everything.
    either way, my hack will only break your mark-up if you try it without the textile plugin being on.

  5. Alex King
    Member
    Posted 10 years ago #

    I've released a plugin to disable the wpautop formatting for a post:
    http://wordpress.org/support/10/5826

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.