Closed brycewray closed 4 years ago
remark-smartypants forwards all options to retext-smartypants, so this should work:
const content = remark()
.use(smartypants, { dashes: 'oldschool' })
.processSync('This should be an em dash: ---')
Let me know if this doesn't work.
Thanks, @silvenon. Worked great! Actually, am using it in a Gridsome repo I'm setting up so it was even simpler than that: I just added it to gridsome.config.js
as follows:
// this is within the overall 'module.exports`...
transformers: {
remark: {
// **global** remark options
plugins: [
['@silvenon/remark-smartypants', {
dashes: 'oldschool',
}
],
// ... and so on
... and all's right with the world with my Markdown's em dashes now. Appreciate the quick reply!
Great! 😉
This plugin's default transformation where dashes are concerned appears to be that
--
produces an em dash and---
isn't changed. Is there any way to config for the so-called "oldschool" setting in which--
produces an en dash and---
produces an em dash? For those who use MultiMarkdown, this would be especially helpful.