Stop using HTML script tags to mark up visible code.

Issue #8617 wontfix
Anonymous created an issue

I was using Chrome to read this page:

It told me I should use another browser to copy the code, because Chrome (and Opera) inserts non-breaking space characters. I opened Firefox and directed it to the page, and found only a gray squiggly line where the code should have been. Viewing the source, I was able to copy the code.

From the W3C:

The script element allows authors to include dynamic script and data blocks in their documents. The element does not represent content for the user.

Please stop using script tags this way! So far I think Safari and Internet Explorer are the only two major browsers that might still do want you intend, and I hate using both of them.

Comments (4)

  1. Brodie Rao


    Thanks for the report! It sounds like you're using NoScript or have JavaScript disabled in Firefox. If you enable JS, you shouldn't have a problem viewing/copying the code examples.

    I don't personally work on Confluence, so I can't speak to why it's using <script> tags there, but if you check out the HTML in the DOM inspector, you'll see that in the end result the content is normal HTML, not script tags. I agree that it's unfortunate that it doesn't degrade gracefully, but as long as you have JS enabled for that page/site, you should be good to go.

  2. Log in to comment