Emulate XMP tag with script tag and allow to copy content

Refresh

6 days ago

Views

15 time

2

Officially <xmp></xmp> is deprecated (but still supported by major browsers), so to be on the lawful side for new applications the only workaround is to replace xmp tag (that don't parse HTML's tags) is to use as I found: <script type="text/plain">...</script>.

Everything is Ok with this solution, but Firefox (ONLY) preventing to copy/paste content enclosed in <script type="text/plain"></script> tag.

Asking to fix it on bugzilla may takes 10-15 years as it is with similar firefox's issue, when one can't copy content from disabled text/textarea elements, so I asking here, may be someone get some workaround to allow copy/paste content enclosed in <script type="text/plain">...</script> or may be there is something better xmp tag replacement to be compatible with nowadays browsers and rules.

Below is example, how I'm using <script type="text/plain">...</script>

To prevent offers to use <pre> or other solutions that modified original content (converting to HTML entities) I should say, - it won't work for me, I have to have original raw content inside <script> tag.