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

Enable SmartyPants option of Marked when rendering Markdown #1163

Closed
callahad opened this issue Mar 14, 2015 · 3 comments
Closed

Enable SmartyPants option of Marked when rendering Markdown #1163

callahad opened this issue Mar 14, 2015 · 3 comments
Labels

Comments

@callahad
Copy link
Contributor

marked.setOptions({smartypants: true}); should automatically change straight quotes like "" into nice quotes like “”.

I'd suggest this default to on, since Marked is smart and avoids applying these transformations to code blocks, but I'd be happy with it being more easily configurable, too.

Unfortunately, the version of Marked that's bundled with Reveal has a bug, but updating to the latest Marked release and setting the above option appears to work seamlessly.

This was referenced Mar 16, 2015
@hakimel
Copy link
Owner

hakimel commented Mar 25, 2015

I'm open to adding an option to the markdown plugin for this. Do you want to give it a shot? It would probably make sense to group markdown plugin options inside one object like:

Reveal.initialize({
  markdown: {
    smartypants: true
  }
})

Which the markdown plugin then consumes via Reveal.getConfig().markdown.smartypants.

@legends2k
Copy link

legends2k commented Dec 5, 2016

It would be good to have @hakimel suggestion, but till then putting this in Reveal.initialize under index.html works:

{ src: 'plugin/markdown/marked.js',
  async: false,
  callback: function() { marked.setOptions({smartypants: true}); } },

@hakimel
Copy link
Owner

hakimel commented Dec 8, 2016

The proposed config option in the comments above was added by @demoneaux in #1765

@hakimel hakimel closed this as completed Dec 8, 2016
SteveDesmond-ca pushed a commit to SteveDesmond-ca/presentations that referenced this issue Apr 19, 2017
derheap pushed a commit to derheap/reveal.js that referenced this issue Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants