A bunch of our content comes from Pandoc. This causes a couple of problems with edits. The first edit with Netlify CMS creates a big pull request that’s almost all reformatting of Markdown. Also, the Markdown occasionally converts to something that doesn’t render right in Hugo.
To avoid problems like this, is there a way to run the content from Pandoc through a filter to normalize it for the Markdown flavor that the Markdown editor in Netlify CMS uses?
Welcome to the Netlify community forums! I believe remark-stringify is being used internally, so that may be a good approach. Perhaps @erez can shed some light on the matter.
That approach seems good to me.
Since netlify-cms-widget-markdown is a separate npm package you might be able to install it and used the exported functions directly.
I tried directly using netlify-cms-widget-markdown. That way should provide the best compatibility, but I had problems. That is a webpack package (ECMAScript modules), but I’m trying to use it directly in node (calling CommonJS modules). My JavaScript/node skills were not up to this. I tried using esm but got many errors. For now, it looks like I’ll extract a subset from that widget.