I am using HTMLPurifier for PHP to ensure that all external links in a piece of HTML that the user provides have the nofollow tag. The problem Is that when I run the code, it will make all links nofollow, including those for my own…