• spiceee

    (@spiceee)


    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');

    Viewing 4 replies - 1 through 4 (of 4 total)
    • carthik

      (@carthik)

      As always, could you please add that to http://wiki.ww.wp.xz.cn please?

      TechGnome

      (@techgnome)

      But what does it DO?
      TG

      Thread Starter spiceee

      (@spiceee)

      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.

      alexkingorg

      (@alexkingorg)

      I’ve released a plugin to disable the wpautop formatting for a post:
      http://ww.wp.xz.cn/support/10/5826

    Viewing 4 replies - 1 through 4 (of 4 total)

    The topic ‘fixing crazy <p>eeing’ is closed to new replies.