I have a text which can contain HTML tags. I want to be able to view it in plain text without html tags being parsed by browser exactly the way HTML code viewers do.
for example:
replacing <div> with <span><</span><span>d</span><span>i</span><span></span>v<span>></span>.
the text may also contain utf-8 characters like Arabic or Farsi. and also all tags must be replaced.
for example:
there is no html tags in this line.
the following line is in farsi:
این یک متن نمونه است به زبان فارسی
<div>
<label>
This is a sample text.
</label>
</div>
the last 4 tags must be replaced in the above code and also the farsi characters must be still readable.