metonym / svelte-highlight

Syntax Highlighting for Svelte using highlight.js
https://svhe.onrender.com
MIT License
253 stars 13 forks source link

feat(line-numbers): support highlighted lines #266

Closed metonym closed 1 year ago

metonym commented 1 year ago

Closes #256

Supports highlighting specific lines through the highlightedLines prop. Customize the background color using --highlighted-background style prop.

<Highlight language={typescript} {code} let:highlighted>
  <LineNumbers {highlighted} highlightedLines={[1, 2]} --highlighted-background="#000" />
</Highlight>

Example
render[bot] commented 1 year ago

Your Render PR Server URL is https://svelte-highlight-pr-266.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-cfkmbvda4990m85q7nr0.

render[bot] commented 1 year ago

Your Render PR Server URL is https://svelte-highlight-pr-266-p7fq.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-cfkmc0da4990m85q7nu0.