开发者

How do I prevent line numbers from appearing in content copied from ordered lists

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 p开发者_开发百科aste 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.


This is a cross-browser compatibility issue, have a look here:

And here for an example that uses prettify and does not select line numbers (you need to select the code text, if you also select the line number it will copy them):


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

the_list_element.style.listStyle = "none";

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜