From 0c9e057a54c691775d52afa390a3c8e2b024b05a Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Fri, 19 Mar 2021 15:36:48 -0600 Subject: [PATCH] core(hreflang): use Audit.makeNodeItem --- lighthouse-core/audits/seo/hreflang.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index 3d49a3f0e280..a5b8781702f2 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -113,13 +113,17 @@ class Hreflang extends Audit { } if (link.source === 'head') { - source = { - type: 'node', - snippet: ``, - path: link.node !== null ? link.node.devtoolsNodePath : '', - selector: link.node !== null ? link.node.selector : '', - nodeLabel: link.node !== null ? link.node.nodeLabel : '', - }; + if (link.node) { + source = { + ...Audit.makeNodeItem(link.node), + snippet: ``, + }; + } else { + source = { + type: 'node', + snippet: ``, + }; + } } else if (link.source === 'headers') { source = `Link: <${link.hrefRaw}>; rel="alternate"; hreflang="${link.hreflang}"`; }