I am making a site where code will be displayed as plain text in a PRE tag (no highlighting, comments, no edit tags) and the I want them to be able to click a button and have the highlighted, commented and edit tag code to appear (also in a pre tag) .
Obviously I have to store the highlighted HTML code somewhere but I was looking for a function like a html2text that will take every essence of the edited PRE tag and convert it to plain text with the plain PRE tag
For example something like this
<pre>
<b>ON SELECT</b>
{
"<edit title="This will be the filename.">beep.wav</edit>" SOUND
}
</pre>
to something like this
<pre>
ON SELECT
{
beep.wav SOUND
}
</pre>
Edit: also anything that would go in a pre tag that is non-html would'nt have < > tags. There would be > and <'s but not an inclosed < > tag. The scripting language doesnt use it. So that means really all I would need is something to extract any closed < > tags.