views:

43

answers:

1

Hi, I'm using a syntax highlighter, Google Prettify to be more specific, and I'm trying to select the content of the code but without the numbers of the li items, and when I say select I mean select with the mouse to copy and paste the code. I wonder if that's possible.

If I'm not clear, please tell me and I will try to explain it better, since English is not my native language.

Well.. thank guys.

A: 

You can use JS to specify the css style list-style on the <ol> element:

the_list_element.style.listStyle = "none";

Hope this helps!

mattbasta
you mean dont show themm at all? The problem is that i want to show the numbers of the lines but prevent them from being copied.
ChrisZ
Unfortunately I don't think you can do that outright with the Google library. I know there are code highlighters that add a link at the top to disable line numbers for this very reason. Others just dump the source code into a textarea. One thing I've seen done is having a GIF with line numbers set as the `background-image` (obviously it runs out after a certain point). Also, I've seen the use of `<canvas>` to make this work in a more HTML5-friendly way. Hope this helps :-/
mattbasta