Skip to content

Commit

Permalink
remove html blocks from the paper before getting the anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnieszka Szuba committed May 16, 2023
1 parent 5959424 commit f90c4a9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import checkNofollow from "../helpers/link/checkNofollow.js";
import getAnchors from "../helpers/link/getAnchorsFromText.js";
import getLinkType from "../helpers/link/getLinkType.js";

import removeHtmlBlocks from "../helpers/html/htmlParser";
/**
* Counts the links found in the text.
*
Expand All @@ -20,7 +20,9 @@ import getLinkType from "../helpers/link/getLinkType.js";
* otherNofollow: other links with a nofollow attribute.
*/
export default function( paper ) {
const anchors = getAnchors( paper.getText() );
let text = paper.getText();
text = removeHtmlBlocks( text );
const anchors = getAnchors( text );
/*
* We get the site's URL (e.g., https://yoast.com) or domain (e.g., yoast.com) from the paper.
* In case of WordPress, the variable is a URL. In case of Shopify, it is a domain.
Expand Down

0 comments on commit f90c4a9

Please sign in to comment.