Replace words in a richtext editor with links
===

Okay so I have a list of words. when a word accors in the text editor i want to change it to a link.
so if I have 

    <p>this is an awesome line</p>
    </p>bla bla another random line</p>
    <a href="google.com">google</a>
and a list containing:

    new list{"awesome", "another", "google"}

I then want to convert the text into

     <p>this is an <a class="dic" href="#">awesome</a> line</p>
     </p>bla bla <a class="dic" href="#">another<a> random line</p>
     <a href="google.com">google</a>
I will do it in c# 

I have tryed the following 

 

    foreach (var article in dics)
                {
                    if (!string.IsNullOrEmpty(article.headword))
                    {
                        bodyText = bodyText.Replace(article.headword, "<a class=\"dic\" href=\"#\">" + article.headword + "</a>");
                        
                    }
                
                }

and some other version of it