Open
Description
Currently there's no way for this plugin to play nice with another code formatting plugin. Because prism.js is so popular within the Gatsby community (I use it myself on my own tech blog), it would be nice to give people the option of using either custom html/markdown tags to inject codefence snippets into their markdown, e.g. [codefence] your code here [/codefence]
I've left the pluginOptions
object exposed within the source code for this reason.
If you are looking to contribute, I would expect a PR addressing this issue to add, at a minimum:
- A test for the existing (vanilla) implementation's output when the triple backtick code formatting block is applied
- Implementation of custom markdown delimiter to be passed by the plugin options to the "visit" function so that nodes matching the delimiter are correctly identified
- Customization of the existing
formatCodeFenceHTML
function so that it correctly produces code fence HTML regardless of what is passed to it - A test for this update