gatsby-remark-highlight-code icon indicating copy to clipboard operation
gatsby-remark-highlight-code copied to clipboard

Config for prismjs?

Open simplenotezy opened this issue 3 years ago • 3 comments

I'd like to disable the left-trim config from Prismjs. Is there a way to change this behaviour?

https://prismjs.com/plugins/normalize-whitespace/

simplenotezy avatar Dec 16 '21 22:12 simplenotezy

Well, I believe it's a config related to prismjs; but not sure. My code does not have proper indentation. This is how it looks:

image

This is how the markdown looks:

image

simplenotezy avatar Dec 16 '21 22:12 simplenotezy

I see.. Might be related to: https://github.com/deckgo/gatsby-remark-highlight-code/issues/53 when adding nowrap.

If I add pre-wrap indentation is back, but then I get wordwrap.

Is there a way to achieve both?

This is my workaround for now, although hacky:

deckgo-highlight-code {
  --deckgo-highlight-code-white-space: pre-wrap;
  --deckgo-highlight-code-container-width: 200vw;
}

simplenotezy avatar Dec 16 '21 22:12 simplenotezy

No options are currently implemented to set the normalize whitespace options of PrismJS.

I'm not against it and PR are welcomed. It would need one in the component and then another PR to add the options to this plugin parser.

Likewise, if a CSS variable is missing, happy to welcome more variables or part.

peterpeterparker avatar Dec 17 '21 06:12 peterpeterparker