Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I auto generate smartquotes?

I'd like to use: http://smartquotesjs.com/ to automatically convert "dumb quotes" into “Smart quotes”.

How do I integrate this library in? I tried just using the instructions that they give, but nothing happens. Presumably because it's run before the dom is actually generated by twine. I couldn't figure out how to do this - any ideas?

Thanks

Comments

  • It's a cool idea, but I don't think smartquotesjs is a very good library; it has an outstanding bug involving not transforming quotes near tags, and a closed but unaddressed issue with the minified version.

    This similar one, Heartquotes.js, seems to work better:
    https://gist.github.com/Permutatrix/6a251d5bc7b27cb238c17d4f7d4c41cf

    You didn't mention a story format. I was able to use Heartquotes in Snowman by adding the following to the story javascript:
    $(window).on('showpassage:after', function (e, data) {
    
      //You'll need to insert all of the raw code from Heartquotes.js here.
    
    });
    

    It did not disturb any of the minimal scripting that I had in my test story, but it may do so for other scripting or other story formats, so caveat emptor.
Sign In or Register to comment.