{"id":125,"date":"2007-04-30T16:10:12","date_gmt":"2007-04-30T21:10:12","guid":{"rendered":"http:\/\/www.nynaeve.net\/?p=125"},"modified":"2019-12-13T17:38:38","modified_gmt":"2019-12-13T22:38:38","slug":"wordpress-can-be-an-incredible-pain-in-the-p-tag","status":"publish","type":"post","link":"http:\/\/www.nynaeve.net\/?p=125","title":{"rendered":"WordPress can be an incredible pain in the &#8216;p&#8217; tag&#8230;"},"content":{"rendered":"<p>I decided to go check that the frontpage of the blog still passed the <a title=\"W3C XML Validator\" href=\"http:\/\/validator.w3.org\">W3C XML validator<\/a> today (something I try to remember to do at least semi-regularly) and, to my dismay, there were validation failures all over the place.<\/p>\n<p>It seems that WordPress is not particularly intelligent about determining where it should and should not place <strong>&lt;p&gt;<\/strong> tags; depending on how you place your <em>whitespace<\/em> around the beginning of a list (ol\/li) or tt (or other tag whose contents tend to span multiple lines), it seems to have quite an affinity for either spewing completely bogus open or close p tags (or closing tags in the wrong order, such as a opening a p tag before a user-specified li tag, then &#8220;helpfully&#8221; automagically closing the p tag <em>before<\/em> the closing li tag the user writes in the post).<\/p>\n<p>The worst part of the whole thing is that the breaking tags are autogenerated, and they&#8217;re controlled by what sort of whitespace (e.g. blank lines) you have near your the opening and closing tags.  Because the &#8220;helpful&#8221; autogenerated tags aren&#8217;t visible at &#8220;design time&#8221; for a post, you&#8217;re all but limited to blind trial and error to get it working right.  Sometimes, you even need to put <em>seemingly bogus <strong>&lt;\/p&gt;<\/strong> tags<\/em> in at &#8220;design time&#8221; to match unbalanced tags emitted by WordPress automagically at display time.<\/p>\n<p>I love how this turns writing blog posts that render properly into debugging something that is influenced by how I use whitespace.  Argh!<\/p>\n<p>Excuse me, while I go back to figuring out the right combination of blank lines to fix the rest of the blog&#8217;s tag close mismatch failures&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided to go check that the frontpage of the blog still passed the W3C XML validator today (something I try to remember to do at least semi-regularly) and, to my dismay, there were validation failures all over the place. It seems that WordPress is not particularly intelligent about determining where it should and should [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/125"}],"collection":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125"}],"version-history":[{"count":1,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":596,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions\/596"}],"wp:attachment":[{"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nynaeve.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}