How to query text-nodes from DOM, find markdown-patterns, replace matches with HTML-markup and replace the original text-node with the new content?
问题 Markdown-like functionality for tooltips Problem: Using Vanilla JavaScript I want to: Change this: <div> <p> Hello [world]{big round planet we live on}, how is it [going]{verb that means walking}? </p> <p> It is [fine]{a word that expresses gratitude}. </p> </div> To this: <div> <p> Hello <mark data-toggle="tooltip" data-placement="top" title="big round planet we live on">world</mark>, how is it <mark data-toggle="tooltip" data-placement="top" title="verb means walking">world</mark>? </p> <p>