There is a text, for example:
> This is a Car
And a dynamic list of tags. For example:
c, car
Expected result is to get this after processing:
This is a <a href='car.ly?search=car'>Car</a>
So:
- It should replace tags with links to search results to these tags
- Longer tags should have prority over shorter tags
- It should not replace tags inside "to phrase", for example "c" in "car.ly" etc.
- search term should be lower case, and title letter case of the tag the same as the original
- It should ommit tags and styling features in input text (it can contain HTML)
I have tested several solutions and no success with it. What is the proper way to handle this case? How to replace tags with a links to search results properly?