-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add a hook for custom behavior #28
Comments
You know, a long time ago there was a suggestion of adding behavior for em dashes and ellipses. I was sort of against it at the time, seeing as this is called "smartquotesjs" and I didn't want this library to get bloated with a bunch of other 'smart' conversions. However, I'm not certain of many other situations besides quotes, em dashes, and ellipses, and possibly a couple others, and I can't find another js library that handles those, so I'd be willing to revisit that instead. Any other scenarios you were thinking of besides the em dash? |
My use case is pretty much just smart quotes and em dashes. I read through #4, and the proposal that they had was to convert double dashes to en dashes and triple dashes to em dashes. On the other hand, I want double dashes to be em dashes, and no en dashes at all. Because the conversion process seems ambiguous, I was thinking it might be better to have a processString hook for the user to do their own logic for their own specific use cases at the cost of added complexity to the user. |
In lieu of this, I've exposed const smartquotes = require('smartquotes');
smartquotes.replacements.push([/\-\-/g, '\u2014']); |
Hi,
I'd like to add a hook for custom behavior -- so for example
to replace double dashes with em dashes. Does that sound fine to you? I'll probably have a PR up today or tomorrow with tests / documentation if yes.
The text was updated successfully, but these errors were encountered: