diff --git a/package.json b/package.json index 921db70..2c32b1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jam-my-stack", - "version": "1.0.8", + "version": "1.0.9", "repository": { "url": "https://github.com/wgroeneveld/jam-my-stack", "type": "git" diff --git a/src/mastodon/feed-parser.js b/src/mastodon/feed-parser.js index eebf008..c65dfb1 100644 --- a/src/mastodon/feed-parser.js +++ b/src/mastodon/feed-parser.js @@ -73,9 +73,10 @@ async function parseMastoFeed(options) { // format: const context = item['thr:in-reply-to'] ? item['thr:in-reply-to']['@_ref'] : "" + // WHY double decode? " = &#34; - first decode '&', then the other char.' return { - title: trimIfNeeded(ent.decode(item.title), titleCount, titlePrefix), // summary (cut-off) of content - content: ent.decode(item.content['#text']), // format: <span class="h-card.... + title: trimIfNeeded(ent.decode(ent.decode(item.title)), titleCount, titlePrefix), // summary (cut-off) of content + content: ent.decode(ent.decode(item.content['#text'])), // format: <span class="h-card.... url: item.id, // format: https://chat.brainbaking.com/objects/0707fd54-185d-4ee7-9204-be370d57663c context, id: stripBeforeLastSlash(item.id), diff --git a/test/mastodon/feed-parser.test.js b/test/mastodon/feed-parser.test.js index 852ef8e..07d94a2 100644 --- a/test/mastodon/feed-parser.test.js +++ b/test/mastodon/feed-parser.test.js @@ -44,7 +44,7 @@ describe("mastodon feed parser tests", () => { const actualMd = await fsp.readFile(`${dumpdir}/2021/03/02h16m18s46.md`) const md = frontMatterParser.parseSync(actualMd.toString()) - expect(md.data.title).toBe("@StampedingLonghorn I tried to chase him away, but you know how that turned out... 😼 There's ...") + expect(md.data.title).toBe("@StampedingLonghorn I tried to chase him away, but you know how that turned out... 😼 There's ...") }) test("parse creates separate notes in each month subdir", async () => {