@ecency/render-helper 2.4.22 → 2.4.23
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/browser/index.js +11 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +11 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +11 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -1232,11 +1232,21 @@ function linkify(content, forApp) {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
|
|
1234
1234
|
// src/methods/text.method.ts
|
|
1235
|
+
function hasAncestor(node, tagNames) {
|
|
1236
|
+
let current = node.parentNode;
|
|
1237
|
+
while (current) {
|
|
1238
|
+
if (tagNames.includes(current.nodeName.toLowerCase())) {
|
|
1239
|
+
return true;
|
|
1240
|
+
}
|
|
1241
|
+
current = current.parentNode;
|
|
1242
|
+
}
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1235
1245
|
function text(node, forApp) {
|
|
1236
1246
|
if (!node || !node.parentNode) {
|
|
1237
1247
|
return;
|
|
1238
1248
|
}
|
|
1239
|
-
if (["a", "code"]
|
|
1249
|
+
if (hasAncestor(node, ["a", "code", "pre"])) {
|
|
1240
1250
|
return;
|
|
1241
1251
|
}
|
|
1242
1252
|
const nodeValue = node.nodeValue || "";
|