pagegraph 0.10.0 → 0.10.1
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.
|
@@ -1096,12 +1096,19 @@ const stringField = (node, field) => {
|
|
|
1096
1096
|
const value = node[field];
|
|
1097
1097
|
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
1098
1098
|
};
|
|
1099
|
-
/**
|
|
1100
|
-
const
|
|
1101
|
-
const
|
|
1102
|
-
const needle = matchText(
|
|
1099
|
+
/** Standard HTML element names; other angle-bracket text is not markup. */
|
|
1100
|
+
const HTML_ELEMENT = new RegExp(`</?(?:${"a abbr address article aside audio b bdi bdo blockquote br button caption cite code col colgroup dd del details dfn div dl dt em fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i img ins kbd label legend li main mark nav ol p picture pre q s samp section small span strong sub summary sup table tbody td tfoot th thead time tr u ul var video wbr".split(" ").join("|")})\\b[^>]*>`, "gi");
|
|
1101
|
+
const inPage = (visible, text) => {
|
|
1102
|
+
const needle = matchText(text);
|
|
1103
1103
|
return needle === "" || ` ${visible} `.includes(` ${needle} `);
|
|
1104
1104
|
};
|
|
1105
|
+
/**
|
|
1106
|
+
* JSON-LD text may carry the HTML Google allows in answers, or plain text with
|
|
1107
|
+
* angle-bracket placeholders such as `samva-<id>._domainkey`, which the page
|
|
1108
|
+
* renders escaped. Only standard element tags are markup, and a candidate with
|
|
1109
|
+
* no closing tag is also compared literally because `<i>` is ambiguous.
|
|
1110
|
+
*/
|
|
1111
|
+
const isVisible = (visible, candidate) => inPage(visible, decodeEntities(candidate.replace(HTML_ELEMENT, " "))) || !/<\//.test(candidate) && inPage(visible, decodeEntities(candidate));
|
|
1105
1112
|
const clip = (value, max = 80) => value.length > max ? `${value.slice(0, max - 1)}…` : value;
|
|
1106
1113
|
const STOPWORDS = new Set("a an and are as at be but by can for from get has have how in into is it its more not of on or our per than that the their this to use via vs was what when who why will with you your".split(" "));
|
|
1107
1114
|
/**
|
|
@@ -1381,4 +1388,4 @@ function checkRenderedContent(graph, documents, policy = {}) {
|
|
|
1381
1388
|
//#endregion
|
|
1382
1389
|
export { lastModified as C, isSitemapEligible as S, renderSitemap as T, checkRenderedCoverage as _, RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION as a, contentSignal as b, diffLinkGraph as c, renderedGraphFromEdges as d, hasBlockingIssues as f, checkGraph as g, checkFreshness as h, renderedCheckTargets as i, extractAnchors as l, checkCoverage as m, checkRenderedContent as n, buildRenderedGraph as o, inspectHtml as p, extractPageContent as r, decodeRenderedEdgeArtifact as s, checkPageContent as t, normalizePath as u, hasStructuralViolations as v, renderRobots as w, inspectNode as x, freshnessReport as y };
|
|
1383
1390
|
|
|
1384
|
-
//# sourceMappingURL=content-
|
|
1391
|
+
//# sourceMappingURL=content-BE9KCTgb.js.map
|