svelte-highlight icon indicating copy to clipboard operation
svelte-highlight copied to clipboard

Is it possible to pass code as a slot?

Open marcaddeo opened this issue 3 years ago • 0 comments

Is it possible to pass code using a slot instead of a prop?

For example, I'd like to be able to do <Highlight language={typescript}> const a = "test"; </Highlight> instead of having to put the code in a prop.

The reason I'd like to see this is I'm using <Highlight /> wrapped in a <code-block> web component and it would feel more natural to pass it as a child/slot.

marcaddeo avatar Oct 17 '22 19:10 marcaddeo