-
-
Save njm2112/6772a8ebe5487557660a63db1d0681d9 to your computer and use it in GitHub Desktop.
A TextExpander snippet to convert clipboard contents: “Curly” quotes to "straight", em-dashes to double-hyphens and ellipses to three periods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$str = `pbpaste`; | |
$find = array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"); | |
$replace = array("'", "'", '"', '"', '-', '--', '...'); | |
echo str_replace($find, $replace, $str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment