{"id":92,"date":"2023-11-27T17:11:00","date_gmt":"2023-11-27T22:11:00","guid":{"rendered":"https:\/\/radio.teledyn.com\/blog\/?p=92"},"modified":"2023-12-06T01:05:24","modified_gmt":"2023-12-06T06:05:24","slug":"hello-buffer","status":"publish","type":"post","link":"https:\/\/radio.teledyn.com\/blog\/2023\/11\/27\/hello-buffer\/","title":{"rendered":"Hello, Buffer"},"content":{"rendered":"<blockquote>\n<p>\nwe do these things not because they are easy, but because we <em>thought<\/em> they would be easy.\n<\/p>\n<\/blockquote>\n<p>\nIt seemed like a very simple idea. Org-mode already provided HTML rendering that worked quite well for static pages, and while the kits for WordPress posting use the dreaded xmlrpc api, with my server on the same LAN as the author, both behind a firewall, it seemed <em>reasonably<\/em> safe to give it a go. This would let me bring anything within reach of Emacs into my published works, and with all the lovely options of Org-Mode, while <em>also<\/em> enabling the wonderfulness of Fediverse presence, structured data and other perks of WordPress plugins.\n<\/p>\n<p>\nThat led me to <code>Org2Blog<\/code> as a candidate, promising your first post in 5 minutes, and while it took 15, the result was impressive.\n<\/p>\n<div id=\"orgcd3066f\" class=\"figure\">\n<p><img decoding=\"async\" src=\"https:\/\/radio.teledyn.com\/blog\/wp-content\/uploads\/2023\/11\/cat-void-stares-back.jpg\" alt=\"Green cat eyes stare at you from the dark within.\" \/>\n<\/p>\n<p><span class=\"figure-number\">Figure 1: <\/span>do not stare into the void<\/p>\n<\/div>\n<div id=\"outline-container-orgb60aac9\" class=\"outline-2\">\n<h2 id=\"orgb60aac9\"><em>So I tried a more complex example\u2026<\/em><\/h2>\n<div class=\"outline-text-2\" id=\"text-orgb60aac9\">\n<p>\n<!--more Everything was beautiful except\u2026--><br \/>\nEverything was beautiful. Not as beautiful as I would have liked<sup><a id=\"fnr.1\" class=\"footref\" href=\"#fn.1\" role=\"doc-backlink\">1<\/a><\/sup> but <em>acceptable<\/em> in every respect except one: Footnotes were garbage. That <em>tiny<\/em> issue has resulted in a week of no progress, a lot of swearing, bad docs, blind alleys, obsolete advice, and still no closer.\n<\/p>\n<p>\nI&#8217;ve dropped that post, starting again because I neglected to save the buffer and there is no <em>re-fetch and edit<\/em> option. I <em>now<\/em> know the publishing does not upload CSS, only the article body is uploaded, and the footnote mangle, which did not happen <em>outside<\/em> of Org2blog-WP, remains inexplicable, and <em>persistent<\/em>.\n<\/p>\n<p>\nThe Chrome browser <em>View Source<\/em> HTML makes no sense:\n<\/p>\n<div class=\"org-src-container\">\n<label class=\"org-src-name\"><em><\/em><\/label><\/p>\n<pre class=\"src src-html\" id=\"nil\">&lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"footnotes\"<\/span>&gt;\n  &lt;<span style=\"color: #9b55c3;\">h2<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footnotes\"<\/span>&gt;<span style=\"font-weight: bold; font-style: italic; text-decoration: underline;\">Footnotes: <\/span>&lt;\/<span style=\"color: #9b55c3;\">h2<\/span>&gt;\n  &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"text-footnotes\"<\/span>&gt;\n    &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footdef\"<\/span>&gt;\n      &lt;<span style=\"color: #9b55c3;\">sup<\/span>&gt;\n        &lt;<span style=\"color: #9b55c3;\">a<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"fn.1\"<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footnum\"<\/span> <span style=\"color: #fb8512;\">href<\/span>=<span style=\"color: #CC5542;\">\"#fnr.1\"<\/span> <span style=\"color: #fb8512;\">role<\/span>=<span style=\"color: #CC5542;\">\"doc-backlink\"<\/span>&gt;1&lt;\/<span style=\"color: #9b55c3;\">a<\/span>&gt;\n      &lt;\/<span style=\"color: #9b55c3;\">sup<\/span>&gt;  &lt;\/<span style=\"color: #9b55c3;\">p<\/span>&gt; <span style=\"color: #6abd50;\">&lt;!-- <\/span><span style=\"color: #6aaf50;\">THE PHANTOM P :gm<\/span><span style=\"color: #6abd50;\"> --&gt;<\/span>\n      &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footpara\"<\/span> <span style=\"color: #fb8512;\">role<\/span>=<span style=\"color: #CC5542;\">\"doc-footnote\"<\/span>&gt;\n        &lt;<span style=\"color: #9b55c3;\">p<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footpara\"<\/span>&gt; this would be the footnote text. &lt;\/<span style=\"color: #9b55c3;\">p<\/span>&gt;\n      &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n    &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n  &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n&lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n<\/pre>\n<\/div>\n<p>\nIf I <em>Inspect<\/em> the footnote, I find a <code>&lt;p&gt;&lt;\/p&gt;<\/code> inserted on a line by itself after the <code>&lt;sub&gt;<\/code> tag.\n<\/p>\n<p>\nTwo things: one is that stray closing P tag in Chrome View Source, the other is the footnote text in a P container that does not include the <code>fn.1<\/code> anchor. It is my <em>guess<\/em> that stray tag is auto-completed by Chrome resulting in the Very Large Gap.\n<\/p>\n<p>\nThe stray tag does not appear in the WordPress editor receiving the generated post:\n<\/p>\n<div class=\"org-src-container\">\n<label class=\"org-src-name\"><em><\/em><\/label><\/p>\n<pre class=\"src src-html\" id=\"nil\">&lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"footnotes\"<\/span>&gt;\n  &lt;<span style=\"color: #9b55c3;\">h2<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footnotes\"<\/span>&gt;<span style=\"font-weight: bold; font-style: italic; text-decoration: underline;\">Footnotes:<\/span>&lt;\/<span style=\"color: #9b55c3;\">h2<\/span>&gt;\n  &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"text-footnotes\"<\/span>&gt;\n    &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footdef\"<\/span>&gt;\n      &lt;<span style=\"color: #9b55c3;\">sup<\/span>&gt;\n        &lt;<span style=\"color: #9b55c3;\">a<\/span> <span style=\"color: #fb8512;\">id<\/span>=<span style=\"color: #CC5542;\">\"fn.1\"<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footnum\"<\/span> <span style=\"color: #fb8512;\">role<\/span>=<span style=\"color: #CC5542;\">\"doc-backlink\"<\/span> <span style=\"color: #fb8512;\">href<\/span>=<span style=\"color: #CC5542;\">\"#fnr.1\"<\/span>&gt;1&lt;\/<span style=\"color: #9b55c3;\">a<\/span>&gt;\n      &lt;\/<span style=\"color: #9b55c3;\">sup<\/span>&gt;\n      &lt;<span style=\"color: #9b55c3;\">div<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footpara\"<\/span> <span style=\"color: #fb8512;\">role<\/span>=<span style=\"color: #CC5542;\">\"doc-footnote\"<\/span>&gt;\n        &lt;<span style=\"color: #9b55c3;\">p<\/span> <span style=\"color: #fb8512;\">class<\/span>=<span style=\"color: #CC5542;\">\"footpara\"<\/span>&gt;the usual footnote sort of stuff.&lt;\/<span style=\"color: #9b55c3;\">p<\/span>&gt;\n      &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n    &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n  &lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n&lt;\/<span style=\"color: #9b55c3;\">div<\/span>&gt;\n<\/pre>\n<\/div>\n<p>\nAnd yet, if I switch the editor to View mode, the phantom gap paragraph is rendered!\n<\/p>\n<p>\nChrome may be attempting to <em>fix<\/em> mis-matched tags, which doesn&#8217;t explain why the phantom is inserted where it is, only trying to excuse its presence. <em>But why would it only appear when rendered by WordPress? A plugin conflict?<\/em>\n<\/p>\n<div class=\"aside\" id=\"org8792bdb\">\n<p>\nThere is a general rule, probably buried in <a href=\"https:\/\/www.w3.org\/TR\/2002\/REC-xhtml1-20020801\/\">the W3 specs<\/a>, where the <code>P<\/code> tag cannot contain a <code>DIV<\/code>, and using curl to extract the source direct into my editor, well, it&#8217;s <em>curious<\/em> because there are no violations of <em>this particular<\/em> rule, but there is that phantom <code>&lt;\/p&gt;<\/code> appended after the <code>&lt;\/sup&gt;<\/code> which is not in the HTML displayed by WordPress. And there is another as well, tucked in after the <code>&lt;\/label&gt;<\/code> tag on an <code>org-src-container<\/code> just before the <code>&lt;pre&gt;<\/code> begins. Emacs gives up code-formatting at this point and complains of an unbalanced <code>DIV<\/code>.\n<\/p>\n<\/div>\n<p>\nIt seems WP <em>adding<\/em> extraneous P tags is common, and while it says nothing about extra <em>closing<\/em> P tags, <a href=\"https:\/\/templ.io\/blog\/prevent-wordpress-from-adding-p-tags-in-content\/\">this offers a theme patch<\/a> to drop all auto-P injections, and, <em>great googley moogleys<\/em> it works!\n<\/p>\n<div class=\"org-src-container\">\n<label class=\"org-src-name\"><em> PHP code appended to <code>functions.php<\/code>.<\/em><\/label><\/p>\n<pre class=\"src src-php\" id=\"nil\"><span style=\"color: #6abd50;\">\/\/ <\/span><span style=\"color: #6aaf50;\">Prevent WP from adding &lt;p&gt; tags on all post types<\/span>\n<span style=\"color: #7d7c61; font-weight: bold;\">function<\/span> <span style=\"color: #9b55c3;\">disable_wp_auto_p<\/span>( $<span style=\"color: #fb8512;\">content<\/span> ) {\n  remove_filter( <span style=\"color: #CC5542;\">'the_content'<\/span>, <span style=\"color: #CC5542;\">'wpautop'<\/span> );\n  remove_filter( <span style=\"color: #CC5542;\">'the_excerpt'<\/span>, <span style=\"color: #CC5542;\">'wpautop'<\/span> );\n  <span style=\"color: #7d7c61; font-weight: bold;\">return<\/span> $<span style=\"color: #fb8512;\">content<\/span>;\n}\nadd_filter( <span style=\"color: #CC5542;\">'the_content'<\/span>, <span style=\"color: #CC5542;\">'disable_wp_auto_p'<\/span>, 0 );\n<\/pre>\n<\/div>\n<p>\nWhich makes my Footnotes quite happy, which makes me happy too. I can move on, I just need to recall what it was I was doing 10 days ago when I hit this.\n<\/p>\n<\/div>\n<div id=\"outline-container-org4f26d29\" class=\"outline-3\">\n<h3 id=\"org4f26d29\">Ok, but what about \\(\\LaTeX\\)? <\/h3>\n<div class=\"outline-text-3\" id=\"text-org4f26d29\">\n<p>\nIt requires the MathJax plugin. If <code>wp-latex<\/code> was built in, it wasn&#8217;t active.\n<\/p>\n<ul class=\"org-ul\">\n<li>what part of \\(c = \\begin{bmatrix} \\frac{\\hbar {G_n}^\\left(d\\right)}{\\left(e^{\\frac{\\phi}{d-1}}\\right)^2}\\end{bmatrix}^\\frac{1}{3}\\) did you not understand?<\/li>\n<\/ul>\n<p>\nAnd that turns out nicely, the braces are perhaps a mis-use of <code>bmatrix<\/code> but that&#8217;s ok, I&#8217;ll be more interested in <em>MusicTeX<\/em> anyway, and therein my next quest.\n<\/p>\n<\/div>\n<\/div>\n<div id=\"outline-container-orgaa0b599\" class=\"outline-3\">\n<h3 id=\"orgaa0b599\">a collection of beginner Org2Blog resources<\/h3>\n<div class=\"outline-text-3\" id=\"text-orgaa0b599\">\n<ul class=\"org-ul\">\n<li><a href=\"https:\/\/github.com\/org2blog\/org2blog\">Org2Blog README<\/a> is surprisingly informative.<\/li>\n<li><a href=\"https:\/\/www.sharons.org.uk\/the-lowdown-on-org2blog.html\">Sharon&#8217;s Low-Down<\/a> from 2013 includes a working configuration example<\/li>\n<li><a href=\"https:\/\/v13.baty.net\/2022\/posting-from-emacs-to-wordpress-using-org2blog\/\">Baty.net<\/a> from 2022 suggests <em>maybe<\/em> it all still works?<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"footnotes\">\n<h2 class=\"footnotes\">Footnotes: <\/h2>\n<div id=\"text-footnotes\">\n<div class=\"footdef\"><sup><a id=\"fn.1\" class=\"footnum\" href=\"#fnr.1\" role=\"doc-backlink\">1<\/a><\/sup> <\/p>\n<div class=\"footpara\" role=\"doc-footnote\">\n<p class=\"footpara\">\nmy benchmark is a beautiful org-mode fed blog called <a href=\"https:\/\/two-wrongs.com\/\">Two Wrongs<\/a> although I <em>suspect<\/em> their process doesn&#8217;t involve either WordPress or Org2Blog.\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:10,&quot;href&quot;:&quot;https:\\\/\\\/www.w3.org\\\/TR\\\/2002\\\/REC-xhtml1-20020801&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250929171355\\\/https:\\\/\\\/www.w3.org\\\/TR\\\/2002\\\/REC-xhtml1-20020801\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-11-01 05:21:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-28 08:16:45&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-01-28 08:16:45&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:11,&quot;href&quot;:&quot;https:\\\/\\\/templ.io\\\/blog\\\/prevent-wordpress-from-adding-p-tags-in-content&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250504020400\\\/https:\\\/\\\/templ.io\\\/blog\\\/prevent-wordpress-from-adding-p-tags-in-content\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-11-01 05:21:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-28 08:16:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-10 07:16:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 10:05:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-06 15:34:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-30 17:57:46&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-30 17:57:46&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:12,&quot;href&quot;:&quot;https:\\\/\\\/github.com\\\/org2blog\\\/org2blog&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250913222854\\\/https:\\\/\\\/github.com\\\/org2blog\\\/org2blog&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-11-01 05:21:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-28 08:16:44&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-01-28 08:16:44&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:14,&quot;href&quot;:&quot;https:\\\/\\\/v13.baty.net\\\/2022\\\/posting-from-emacs-to-wordpress-using-org2blog&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20240418110515\\\/https:\\\/\\\/v13.baty.net\\\/2022\\\/posting-from-emacs-to-wordpress-using-org2blog\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-11-01 05:22:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-28 08:16:48&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-01-28 08:16:48&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:15,&quot;href&quot;:&quot;https:\\\/\\\/two-wrongs.com&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20240804172434\\\/https:\\\/\\\/two-wrongs.com\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-11-01 05:22:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-28 08:16:43&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-01-28 08:16:43&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>we do these things not because they are easy, but because we thought they would be easy. It seemed like a very simple idea. Org-mode already provided HTML rendering that worked quite well for static pages, and while the kits for WordPress posting use the dreaded xmlrpc api, with my server on the same LAN &hellip; <a href=\"https:\/\/radio.teledyn.com\/blog\/2023\/11\/27\/hello-buffer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Hello, Buffer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[20],"tags":[16,21,22],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-tools","tag-emacs","tag-org2blog","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":46,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/radio.teledyn.com\/blog\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}