Remove HTML tags in script
<p>I've found this piece of code on the internet. It takes a sentence and makes every single word into link with this word. But it has weak side: if a sentence has HTML in it, this script doesn't remove it.</p>

<p>For example: it replaces '<code>&lt;b&gt;asserted&lt;/b&gt;</code>' with '<code>http://www.merriam-webster.com/dictionary/&lt;b&gt;asserted&lt;/b&gt;</code>'</p>

<p>Could you please tell me what to change in this code for it to change '<code>&lt;b&gt;asserted&lt;/b&gt;</code>' to '<code>http://www.merriam-webster.com/dictionary/asserted</code>'.</p>

<pre><code>var content = document.getElementById("sentence").innerHTML;

var punctuationless = content.replace(/[.,\/#!$%\؟^?&amp;\*;:{}=\-_`~()”“"]/g, "");
var mixedCase = punctuationless.replace(/\s{2,}/g);
var finalString = mixedCase.toLowerCase();

var words = (finalString).split(" ");

var punctuatedWords = (content).split(" ");

var processed = "";
for (i = 0; i &lt; words.length; i++) {
    processed += "&lt;a href = \"http://www.merriam-webster.com/dictionary/" + words[i] + "\"&gt;";
    processed += punctuatedWords[i];
    processed += "&lt;/a&gt; ";
}

document.getElementById("sentence").innerHTML = processed;
</code></pre>