@hackersheet/react-document-content 0.1.0-alpha.17 → 0.1.0-alpha.19

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.
@@ -45,14 +45,15 @@ function LinkCardComponentResolver({
45
45
  if (!href) {
46
46
  return /* @__PURE__ */ import_react.default.createElement("p", null, children);
47
47
  }
48
- const website = document.websites.find((website2) => website2.url === href);
48
+ const hrefWithoutHash = typeof href === "string" ? href.split("#")[0] : href;
49
+ const website = document.websites.find((website2) => website2.url === hrefWithoutHash);
49
50
  if (!website) {
50
51
  return /* @__PURE__ */ import_react.default.createElement("p", null, children);
51
52
  }
52
53
  return /* @__PURE__ */ import_react.default.createElement(
53
54
  LinkCardComponent,
54
55
  {
55
- url: website.url,
56
+ url: String(href),
56
57
  title: website.ogTitle || website.title || website.url,
57
58
  description: website.ogDescription || website.description,
58
59
  domain: website.domain,
@@ -12,14 +12,15 @@ function LinkCardComponentResolver({
12
12
  if (!href) {
13
13
  return /* @__PURE__ */ React.createElement("p", null, children);
14
14
  }
15
- const website = document.websites.find((website2) => website2.url === href);
15
+ const hrefWithoutHash = typeof href === "string" ? href.split("#")[0] : href;
16
+ const website = document.websites.find((website2) => website2.url === hrefWithoutHash);
16
17
  if (!website) {
17
18
  return /* @__PURE__ */ React.createElement("p", null, children);
18
19
  }
19
20
  return /* @__PURE__ */ React.createElement(
20
21
  LinkCardComponent,
21
22
  {
22
- url: website.url,
23
+ url: String(href),
23
24
  title: website.ogTitle || website.title || website.url,
24
25
  description: website.ogDescription || website.description,
25
26
  domain: website.domain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackersheet/react-document-content",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "Hacker Sheet document content component for React.",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "remark-gfm": "^4.0.1",
39
39
  "remark-math": "^6.0.0",
40
40
  "unist-util-visit": "^5.1.0",
41
- "@hackersheet/core": "0.1.0-alpha.13",
41
+ "@hackersheet/core": "0.1.0-alpha.14",
42
42
  "@hackersheet/react-document-content-styles": "0.1.0-alpha.17"
43
43
  },
44
44
  "devDependencies": {