Monday, November 02, 2026
An HTML title from Ηελλ
I had some small changes to mod_blog queued up when I noticed my gopher feed had the following in it:
- /2026/10/14 Notes on an overheard conversation in a parking lot - /2026/10/11 The closet situation has been resolved - /2026/09/19 I never did ask her why she was eating Trader Joe's Cheezy Poofs in a Publix parking lot - /2026/09/06 Notes on an overheard conversation at a D&D game - /2026/09/01 Is it too early to call Google and Microsoft an email cartel? - /2026/08/31 I guess this falls into the hate the game, not the player territory - /2026/08/31 There's a more interesting story in Star Wars: The Phantom Menance than we ever got to see - /2026/08/20 Notatoy - /2026/08/17 Yet more noise on emails from other Sean Conners on the Intarwebs * Full archives * Main Site
The issue was on the September 6th entry with the “D&D” text. I didn't want that there; what should have been there was “D&D”, and therein lies a surprisingly annoying task for the past week.
The bit above is generated from a template file, one of several I use to generate things around here. The particular bit of of the template was:
0%{entry.date}% %{entry.title}% Phlog:%{entry.path}% gopher.conman.org 70
Where %{entry.title}% just writes out the entry title as is.
And in that case,
the entry title as is,
is
Notes on an overheard conversation at a D&D game
It's not a secret that I mirror my blog to both Gopher and Gemini,
and to do so,
I convert each entry from HTML to a plain text formatted to 80 columns for Gopher,
and to the rather horrible (in my opinion) text/gemini format used by Gemini
(and for the record,
I found it easier to convert HTML to plain text than to text/gemini).
The trouble is—for both Gopher and Gemini,
any HTML entities that exist in the title should be converted to their UTF-8 equivalent.
But I can't just switch the template rule entry.title to de-entify the string,
as that is also used for HTML output.
The easy thing was to add yet another template rule,
entry.title.deentify,
use that in the appropriate places,
and be done with it.
Then I noticed another issue—some of the titles of my blog entries contain HTML tags. Not many, and more in the past then these days, but they do exist. And for the most part, it's perfectly fine, except when it isn't.
You see,
the header tags
(you know, <H1>, <H2>, <H3>, <H4> and so on)
are block level elements and can contain in-line elements,
like <EM> and <CODE>,
but the <TITLE> tag cannot.
And in some cases,
the title of the entry is used in the <TITLE> tag.
And the new template rule of entry.title.deentify did nothing to handle those cases,
like this entry from 2001,
which is:
Move over <ABBR TITLE="Bastard Operator From Hell">BOFH</ABBR>, here comes Gord …
which would be rendered in Gopher or Gemini feed files,
or in the HTML <TITLE> tag as “Move over <ABBR TITLE="Bastard Operator From Hell">BOFH</ABBR>, here comes Gord …”
No something I want.
So back to the drawing board,
and I ended up with two new template rules,
entry.title.dehtml,
which strips any tags and converts entities to UTF-8 characers,
and entry.title.detag,
which keeps entities as is,
but removes tags.
The former is used for generating the Gopher and Gemini feeds,
and the later is used when generating a title in the <TITLE> tag.
And since then it's been a game of “Whack-a-Mole” with various template rules and titles.
Stuff like the title from the first entry
(nagivation.first.title.dehtml and navigation.first.title.detag),
the last entry
(I'll spare you the template rule names),
the next entry,
and the previous entry.
And just today,
I found that I had to do yet even more in the code that does the translation from HTML to Gopher and Gemini formats,
by treating the titles as a fragment of HTML to covert.
I think I've found all the spots where HTML could spill over into Gopher or Gemini, but I kept thinking that over the past few days.
Update about twenty minutes later …
Of course, when I added this entry, I found a few more places that needed fixing …
Sigh.
![Oh Chrismtas Tree! My Christmas Tree! Rise up and hear the bells! [Self-portrait with a Christmas Tree] Oh Chrismtas Tree! My Christmas Tree! Rise up and hear the bells!](https://www.conman.org/people/spc/about/2025/1203.t.jpg)