@rmdes/indiekit-endpoint-microsub 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/feeds/normalizer.js +12 -4
- package/package.json +1 -1
package/lib/feeds/normalizer.js
CHANGED
|
@@ -150,7 +150,9 @@ export function normalizeItem(item, feedUrl, feedType) {
|
|
|
150
150
|
type: "entry",
|
|
151
151
|
uid,
|
|
152
152
|
url,
|
|
153
|
-
name: item.title
|
|
153
|
+
name: item.title
|
|
154
|
+
? sanitizeHtml(item.title, { allowedTags: [] }).trim()
|
|
155
|
+
: undefined,
|
|
154
156
|
published: toISOStringSafe(item.pubdate),
|
|
155
157
|
updated: toISOStringSafe(item.date),
|
|
156
158
|
_source: {
|
|
@@ -241,7 +243,9 @@ export function normalizeItem(item, feedUrl, feedType) {
|
|
|
241
243
|
*/
|
|
242
244
|
export function normalizeFeedMeta(meta, feedUrl) {
|
|
243
245
|
const normalized = {
|
|
244
|
-
name: meta.title
|
|
246
|
+
name: meta.title
|
|
247
|
+
? sanitizeHtml(meta.title, { allowedTags: [] }).trim()
|
|
248
|
+
: feedUrl,
|
|
245
249
|
};
|
|
246
250
|
|
|
247
251
|
if (meta.description) {
|
|
@@ -303,7 +307,9 @@ export function normalizeJsonFeedItem(item, feedUrl) {
|
|
|
303
307
|
type: "entry",
|
|
304
308
|
uid,
|
|
305
309
|
url,
|
|
306
|
-
name: item.title
|
|
310
|
+
name: item.title
|
|
311
|
+
? sanitizeHtml(item.title, { allowedTags: [] }).trim()
|
|
312
|
+
: undefined,
|
|
307
313
|
published: item.date_published
|
|
308
314
|
? new Date(item.date_published).toISOString()
|
|
309
315
|
: undefined,
|
|
@@ -400,7 +406,9 @@ export function normalizeJsonFeedItem(item, feedUrl) {
|
|
|
400
406
|
*/
|
|
401
407
|
export function normalizeJsonFeedMeta(feed, feedUrl) {
|
|
402
408
|
const normalized = {
|
|
403
|
-
name: feed.title
|
|
409
|
+
name: feed.title
|
|
410
|
+
? sanitizeHtml(feed.title, { allowedTags: [] }).trim()
|
|
411
|
+
: feedUrl,
|
|
404
412
|
};
|
|
405
413
|
|
|
406
414
|
if (feed.description) {
|
package/package.json
CHANGED