I am making a Windows 8 app with HTML + JS and have a field where the user can input some data, when they revisit the page I set a <div>
equal to their input. It is possible they may input a URL so I want to convert it to a link. Every example I has read about talks about enclosing it in an tag however when I write the text into the div I use "div.innerText" rather than "div.innerHTML" in case the user wrote incorrect HTML as their data which then causes the app to crash.
Is there anyway I can fail safe against the user entering incorrect HTML and still have hyperlinks in the text?