@ecency/render-helper 2.5.9 → 2.5.10
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/dist/node/index.cjs
CHANGED
|
@@ -756,7 +756,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext, renderOptions) {
|
|
|
756
756
|
el.setAttribute("data-author", author);
|
|
757
757
|
el.setAttribute("data-permlink", permlink);
|
|
758
758
|
} else {
|
|
759
|
-
const h =
|
|
759
|
+
const h = `/@${author}/${permlink}`;
|
|
760
760
|
el.setAttribute("href", h);
|
|
761
761
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
762
762
|
}
|
|
@@ -835,7 +835,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext, renderOptions) {
|
|
|
835
835
|
el.setAttribute("data-author", author);
|
|
836
836
|
el.setAttribute("data-permlink", permlink);
|
|
837
837
|
} else {
|
|
838
|
-
const h =
|
|
838
|
+
const h = `/@${author}/${permlink}`;
|
|
839
839
|
el.setAttribute("href", h);
|
|
840
840
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
841
841
|
}
|
|
@@ -900,7 +900,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext, renderOptions) {
|
|
|
900
900
|
el.setAttribute("data-author", author);
|
|
901
901
|
el.setAttribute("data-permlink", permlink);
|
|
902
902
|
} else {
|
|
903
|
-
const h =
|
|
903
|
+
const h = `/@${author}/${permlink}`;
|
|
904
904
|
el.setAttribute("href", h);
|
|
905
905
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
906
906
|
}
|
|
@@ -986,7 +986,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext, renderOptions) {
|
|
|
986
986
|
el.setAttribute("data-author", author);
|
|
987
987
|
el.setAttribute("data-permlink", permlink);
|
|
988
988
|
} else {
|
|
989
|
-
const h =
|
|
989
|
+
const h = `/@${author}/${permlink}`;
|
|
990
990
|
el.setAttribute("href", h);
|
|
991
991
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
992
992
|
}
|
|
@@ -1530,7 +1530,7 @@ function linkify(content, forApp, renderOptions) {
|
|
|
1530
1530
|
const attrs = forApp ? `href="https://ecency.com/@${authorLower}/${permlink}"` : `href="/@${authorLower}/${permlink}"`;
|
|
1531
1531
|
return `${preceding}<a class="markdown-profile-link" ${attrs}>@${authorLower}/${permlink}</a>`;
|
|
1532
1532
|
} else {
|
|
1533
|
-
const attrs = forApp ? `data-author="${authorLower}" data-tag="${tag}" data-permlink="${permlink}"` : `href="
|
|
1533
|
+
const attrs = forApp ? `data-author="${authorLower}" data-tag="${tag}" data-permlink="${permlink}"` : `href="/@${authorLower}/${permlink}"`;
|
|
1534
1534
|
return `${preceding}<a class="markdown-post-link" ${attrs}>@${authorLower}/${permlink}</a>`;
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
@@ -1545,7 +1545,7 @@ function linkify(content, forApp, renderOptions) {
|
|
|
1545
1545
|
const attrs = forApp ? `href="https://ecency.com/@${uu}/${permlink}"` : `href="/@${uu}/${permlink}"`;
|
|
1546
1546
|
return ` <a class="markdown-profile-link" ${attrs}>@${uu}/${permlink}</a>`;
|
|
1547
1547
|
} else {
|
|
1548
|
-
const attrs = forApp ? `data-author="${uu}" data-tag="post" data-permlink="${permlink}"` : `href="
|
|
1548
|
+
const attrs = forApp ? `data-author="${uu}" data-tag="post" data-permlink="${permlink}"` : `href="/@${uu}/${permlink}"`;
|
|
1549
1549
|
return ` <a class="markdown-post-link" ${attrs}>@${uu}/${permlink}</a>`;
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
@@ -1640,7 +1640,7 @@ function text(node, forApp, renderOptions) {
|
|
|
1640
1640
|
if (!tag || !/^[a-z0-9_-]+$/i.test(tag)) return;
|
|
1641
1641
|
if (!isValidUsername(author)) return;
|
|
1642
1642
|
if (!isValidPermlink(permlink)) return;
|
|
1643
|
-
const attrs = forApp ? `data-tag="${tag}" data-author="${author}" data-permlink="${permlink}" class="markdown-post-link"` : `class="markdown-post-link" href="
|
|
1643
|
+
const attrs = forApp ? `data-tag="${tag}" data-author="${author}" data-permlink="${permlink}" class="markdown-post-link"` : `class="markdown-post-link" href="/@${author}/${permlink}"`;
|
|
1644
1644
|
const doc = DOMParser.parseFromString(
|
|
1645
1645
|
`<a ${attrs}>/@${author}/${permlink}</a>`,
|
|
1646
1646
|
"text/html"
|