question

Jeff Moden avatar image
Jeff Moden asked

How to copy from code block without line numbers on this site?

I don't use this site as much as I probably should. I've checked the FAQ and this Meta-Askssc tag but I'm not finding what I need. How do you copy the code from a code block without including the line numbers?
meta-askssc
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

That is a very good question. (p.s. Jeff - thanks for your kind comments earlier - I can't see them on the site, so can't reply directly - but will as soon as that is rectified)
0 Likes 0 ·
Jeff Moden avatar image
Jeff Moden answered
Thanks for the answer, Dave. I just wanted to make sure this ol' man wasn't going blind. ;-) I did figure out a work around for now, in case someone else asks. If you copy the code and paste it into Word as HTML, it will show up with line numbers on every line. Just select all the code in Word {ctrl-A} and click on the "paragraph number" button to turn off the numbering. Then, copy and paste into SSMS.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DaveC avatar image
DaveC answered
You can't - the line numbers are added as part of the CSS styling. Currently we're reliant on Google's default prettifier code styling, but we're looking to replace this in future.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What ever you do, don't use the new one they have on SQLServerCentral. They really boned it up there. It's horrible. I've been trying to give the 3rd party "developer" of the code some info on what needs to be done but I've not seen anything promising yet. Considering that your last message is now 4 years old, I'm guessing we don't have to worry about you good folks making any changes here in the near future. That's not such a bad thing from what I've seen on SSC.
0 Likes 0 ·
Thanks Jeff, incredibly helpful.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.