deckgo / gatsby-remark-highlight-code

Adds stylish cards and syntax highlighting to code blocks in markdown files
MIT License
67 stars 18 forks source link

feat: added javascript as default language if no language is supplied #42

Closed joshuamorony closed 3 years ago

joshuamorony commented 3 years ago

Added JS as the default language in response to issue #40 - could also potentially add an extra configuration option to the plugin to specify a default language if that's the way you want to go.

peterpeterparker commented 3 years ago

Thanks for the PR @joshuamorony ! I had a deeper look and I think the issue #40 is incorrect. The issue is not that language="javascript" is not set (the default should be set by Stencil when no attribute is defined) but, rather that it parses and undefined value for higlight-lines which has for side effect to obfuscate (opacity 0.4 or so) the code.

Tested with my website:

<deckgo-highlight-code class="deckgo-highlight-code-carbon deckgo-highlight-code-theme-dracula hydrated" language="javascript" terminal="carbon" theme="dracula" highlight-lines="undefined">

I can try to solve this later today or tomorrow, not gonna ask you to update your PR. Thanks a lot!

peterpeterparker commented 3 years ago

I think I solved it in https://github.com/deckgo/gatsby-remark-highlight-code/pull/43

I've to go offline, will double check tomorrow.

Thanks again!