From 993300d204669cf0d48ffb7f0ed48921b61cd946 Mon Sep 17 00:00:00 2001 From: Chris Burnell Date: Fri, 19 Jan 2024 22:23:11 +0800 Subject: [PATCH] fix: getWebmentionContent filter --- README.md | 4 ++-- eleventy-cache-webmentions.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b10dd6..ed514bd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Breaking change for v2.0.0 -Version 2.0.0 introduces a breaking change for those migrating from earlier versions of the plugin. This affects usage of the plugin from JavaScript files; specifically, you will need to make a small change to the way that you require() the plugin by removing an extra set of parentheses: +Version 2.0.0 introduces a breaking change for those migrating from earlier versions of the plugin. This affects usage of the plugin from JavaScript files; specifically, you will need to make a small change to the way that you `require()` the plugin by removing an extra set of parentheses: **v1.2.5 and below** @@ -12,7 +12,7 @@ Version 2.0.0 introduces a breaking change for those migrating from earlier vers require("@chrisburnell/eleventy-cache-webmentions")() ``` -**v2.0.0** +**v2.0.0 and above** ```javascript require("@chrisburnell/eleventy-cache-webmentions") diff --git a/eleventy-cache-webmentions.js b/eleventy-cache-webmentions.js index 1077948..9dbda7d 100644 --- a/eleventy-cache-webmentions.js +++ b/eleventy-cache-webmentions.js @@ -42,7 +42,7 @@ const getPublished = (webmention) => { } const getContent = (webmention) => { - return webmention?.["content"]?.["html"] || webmention?.["content"] || webmention?.["data"]?.["content"] || "" + return webmention?.["contentSanitized"] || webmention?.["content"]?.["html"] || webmention?.["content"]?.["value"] || webmention?.["content"] || webmention?.["data"]?.["content"] || "" } const getSource = (webmention) => { diff --git a/package.json b/package.json index 0f2893c..99ac28f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chrisburnell/eleventy-cache-webmentions", - "version": "2.0.0", + "version": "2.0.1", "description": "Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.", "author": "Chris Burnell ", "license": "MIT",