Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom markdown delimitors #2

Open
jamessimone opened this issue May 24, 2020 · 0 comments
Open

Add support for custom markdown delimitors #2

jamessimone opened this issue May 24, 2020 · 0 comments
Labels
good first issue Good for newcomers

Comments

@jamessimone
Copy link
Owner

jamessimone commented May 24, 2020

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:

  1. A test for the existing (vanilla) implementation's output when the triple backtick code formatting block is applied
  2. 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
  3. Customization of the existing formatCodeFenceHTML function so that it correctly produces code fence HTML regardless of what is passed to it
  4. A test for this update
@jamessimone jamessimone added the good first issue Good for newcomers label May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant