Skip to content

Commit b0cce08

Browse files
feat: add featured to ignored properties for referencing
1 parent 0edca1d commit b0cce08

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

lib/fetch-references.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { mf2tojf2 } from "../index.js";
22
import { fetchMf2 } from "./fetch-mf2.js";
33

4-
const ignoredProperties = new Set(["audio", "photo", "url", "video"]);
4+
const ignoredProperties = new Set([
5+
"audio",
6+
"featured",
7+
"photo",
8+
"url",
9+
"video",
10+
]);
511

612
/**
713
* Get a list of URLs that can be referenced

test/fetch-references.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe("mf2tojf2", () => {
1313
name: "What my friend ate for lunch yesterday",
1414
published: "2019-02-12T10:00:00.000+00:00",
1515
photo: "https://website.example/photo.jpg",
16+
featured: "https://website.example/media/lunch.jpg",
1617
category: ["foo", "bar"],
1718
url: "https://website.example/bookmarks/lunch",
1819
"bookmark-of": "https://another.example/notes/lunch",
@@ -24,6 +25,7 @@ describe("mf2tojf2", () => {
2425
name: "What my friend ate for lunch yesterday",
2526
published: "2019-02-12T10:00:00.000+00:00",
2627
photo: "https://website.example/photo.jpg",
28+
featured: "https://website.example/media/lunch.jpg",
2729
category: ["foo", "bar"],
2830
url: "https://website.example/bookmarks/lunch",
2931
"bookmark-of": "https://another.example/notes/lunch",

test/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,12 @@ describe("mf2tojf2", () => {
657657
properties: {
658658
name: ["What my friend ate for lunch yesterday"],
659659
published: ["2019-02-12T10:00:00.000+00:00"],
660+
featured: [
661+
{
662+
value: "https://website.example/media/lunch.jpg",
663+
alt: "A cheese sandwich",
664+
},
665+
],
660666
url: ["https://website.example/bookmarks/lunch"],
661667
"mp-syndicate-to": "https://example.social/@username",
662668
},
@@ -669,6 +675,12 @@ describe("mf2tojf2", () => {
669675
type: "entry",
670676
name: "What my friend ate for lunch yesterday",
671677
published: "2019-02-12T10:00:00.000+00:00",
678+
featured: [
679+
{
680+
url: "https://website.example/media/lunch.jpg",
681+
alt: "A cheese sandwich",
682+
},
683+
],
672684
url: "https://website.example/bookmarks/lunch",
673685
"mp-syndicate-to": "https://example.social/@username",
674686
},

0 commit comments

Comments
 (0)