ekalinin / typogr.js

Typography utils for javascript
MIT License
297 stars 20 forks source link

Smartypants inconsistent behavior in converting back tick style quotes to curly quotes #46

Open bshifrin opened 3 years ago

bshifrin commented 3 years ago

Smartypants converts back tick style quote in a different way if it's in the beginning of the string.

const typogr = require("typogr");

let text = "'wrong', 'right'";
text = typogr(text).chain().smartypants().value();

document.getElementById("app").innerHTML = text;

Result: ’wrong’, ‘right’

Expected result: ‘wrong’, ‘right’

https://codesandbox.io/embed/mutable-water-7gmyi?fontsize=14&hidenavigation=1&theme=dark