If you have some text highlighted on the code snippet it preserves that highlighting when the image is generated.
Not sure if this is desired or not. I unexpectedly generated an image with the highlight when I didn't want it.
Thanks for an awesome resource!
If you look at what's actually converting your code into an image
https://github.com/dawnlabs/carbon/blob/de11ff034fe4bc270ddf9550d6d12e3b3a1ba6c2/pages/editor.js#L75-L88
... and
https://github.com/dawnlabs/carbon/blob/de11ff034fe4bc270ddf9550d6d12e3b3a1ba6c2/pages/editor.js#L94-L103
... it merely just picks up your code and converts it to a .PNG image. Internally, it (the 3rd party library, dom-to-image) calls HTMLCanvasElement.toDataURL(), which in turns just returns a data URI.
IMO, I think the text highlight is a good thing, as I would sometimes want to highlight important sections of my code. Whether it was intended or not, I can't quite say. Hope this helps, tho!
Thanks for the code reference.
I don't mind it either way... but wasn't sure if it was desired or not so figured I'd submit an issue and allow the maintainers to decide.
It wasn't intended, but I'm with @yeskunall in that it can sometimes prove useful. Let's keep it in for now. Thanks for reporting, @vmitchell85, we're glad you like Carbon 👍.
Most helpful comment
If you look at what's actually converting your code into an image
https://github.com/dawnlabs/carbon/blob/de11ff034fe4bc270ddf9550d6d12e3b3a1ba6c2/pages/editor.js#L75-L88
... and
https://github.com/dawnlabs/carbon/blob/de11ff034fe4bc270ddf9550d6d12e3b3a1ba6c2/pages/editor.js#L94-L103
... it merely just picks up your code and converts it to a .PNG image. Internally, it (the 3rd party library,
dom-to-image) callsHTMLCanvasElement.toDataURL(), which in turns just returns a data URI.IMO, I think the text highlight is a good thing, as I would sometimes want to highlight important sections of my code. Whether it was intended or not, I can't quite say. Hope this helps, tho!