-6

Give me the liberty to disable this problematic syntax highlighting script, please. It does more harm for me than good.

5
  • What is so problematic about it? I don't notice anything wrong with the results of it.
    – Sampson
    Commented Sep 4, 2009 at 21:01
  • 1
    It's weak on several languages like VB, even sql somewhat.
    – Joel Coehoorn Mod
    Commented Sep 4, 2009 at 21:48
  • It's also just plain terrible on Perl. Commented Sep 8, 2009 at 0:48
  • @Brad: <insert cheap shot about Perl here>. Commented Oct 18, 2010 at 7:19
  • Way I seen it now: "user130648 request to make javascript syntax highlighter to upset". I think title could use some rewording.
    – Mołot
    Commented Jul 3, 2013 at 9:14

1 Answer 1

5

Use <pre> instead.

$(function(){
  $("div.someBox").remove();
});

vs

$(function(){
  $("div.someBox").remove();
});

If you wanated to disable this, you could do so with a greasemonkey script and firefox. You'd have to get the $.text() value of the pre.prettyprint, and then replace the pre.prettyprint with code tags.

8
  • Does PRE stop the Javascript syntax highlighter from highlighting it on window.onload?
    – user130648
    Commented Sep 4, 2009 at 20:51
  • 1
    How can I get other people to do this so when I open a question it doesnt screw everything up?
    – user130648
    Commented Sep 4, 2009 at 20:56
  • The service used to highlight code only works on the <code> tags if I'm not mistaken, so you should use the <pre> tags when you want to display code without having it highlighted. If you're experiencing serious problems with the rendering, you should probably consider submitting a bug-report.
    – Sampson
    Commented Sep 4, 2009 at 20:58
  • When I copy it, it all gets scrunched into one line. It converts string literal &nbsp; in my code into an actual space. In one answer, my HTML decoding code snippet ended up removing every space from the given string, instead of nbsp;
    – user130648
    Commented Sep 4, 2009 at 21:39
  • That task should not be left up to the client machine anyways. It's BS.
    – user130648
    Commented Sep 4, 2009 at 21:40
  • The OP wants to disable it on the local browser, not globally. Commented Sep 8, 2009 at 0:50
  • Greasemonkey! :)
    – Sampson
    Commented Sep 8, 2009 at 17:07
  • 3
    Note that if you are trying to disable syntax highlighting for a preformatted block (that you are authoring), it appears that <!-- language: none --> is the preferred mechanism.
    – Phrogz
    Commented Mar 31, 2011 at 22:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .