From bb2550793ef7538abba14ef1fc158299a93c18a5 Mon Sep 17 00:00:00 2001 From: Alistair Brown Date: Thu, 8 Oct 2026 21:59:55 +0100 Subject: [PATCH] Decode HTML entities in Horse Hospital titles Squarespace writes the event name into the JSON-LD HTML-escaped, so a title with an ampersand came through as "&". Co-Authored-By: Claude Opus 5.5 --- cinemas/thehorsehospital.com/transform.js | 5 ++++- common/tests/test-titles.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cinemas/thehorsehospital.com/transform.js b/cinemas/thehorsehospital.com/transform.js index 04e8a62e..b46b5418 100644 --- a/cinemas/thehorsehospital.com/transform.js +++ b/cinemas/thehorsehospital.com/transform.js @@ -1,4 +1,5 @@ const cheerio = require("cheerio"); +const { decode } = require("html-entities"); const { getText, generateShowingId, @@ -32,7 +33,9 @@ async function transform({ moviePages }, sourcedEvents) { const $ = cheerio.load(moviePage); const eventData = getEventJsonLd($); const id = $("article.eventitem").attr("data-item-id"); - const title = eventData.name.replace(" — The Horse Hospital", ""); + // Squarespace writes the name into the JSON-LD HTML-escaped ("&"), and + // JSON.parse leaves that alone. + const title = decode(eventData.name).replace(" — The Horse Hospital", ""); const date = new Date(eventData.startDate); const description = getText($(".sqs-html-content")); diff --git a/common/tests/test-titles.json b/common/tests/test-titles.json index 1e42824e..5e4eaa5c 100644 --- a/common/tests/test-titles.json +++ b/common/tests/test-titles.json @@ -101312,7 +101312,7 @@ "output": "consumed a contemporary asian horror showcase" }, { - "input": "'RAFT' & The Parlour Collective & 'The Moon Over The Alley'", + "input": "'RAFT' & The Parlour Collective & 'The Moon Over The Alley'", "output": "raft the parlour collective the moon over the alley" }, {