Adding support for custom markers
Closed this issue · 2 comments
Hi Neal, thanks for the awesome plugin!
I wanted to use the plugin using a different syntax other than code block ``, since it prevents netlifyCMS to correctly parse & display a preview, described in this stackoverflow question. It might also helps with #13 if I understand that one correctly.
I have been writing a custom tokenizer plugin for remark, aiming to make it easier to write custom static component for markdown in gatsby. I implemented the feature using my plugin here.
With this, it allows user to use self-defined syntax, such as
[[youtube: gdviJzEwShE]]
or
---youtube: gdviJzEwShE---
It still support the inline code syntax `youtube: gdviJzEwShE`
, and will not invoke the custom parser unless user specifies a custom syntax.
edit: Here's a test gatsby site
Within Gatsby's eco system, using inline code will cause no issues, so I understand this is a niche usage. If you like what I've done, I would love to send over a PR & discuss further. If not, I'd like to ask for your permission to publish my fork as a separate package on npm.
Thanks again!
Sorry, I am currently busy with other things... but a very cool idea, that was one of the things I wanted to actually have from the beginning - but well - time constraints.
If you send over a PR then Ill take a closer look at it and merge it in.
This would be very helpful since I can't have both video embeds and code highlighting at the same time at the moment because of the syntax used by this plugin