Last active
September 14, 2024 15:45
-
-
Save joshua-koehler/769c405cc117653ae19aa51495348e94 to your computer and use it in GitHub Desktop.
Copy Markdown from stdin to clipboard in RTF format - OSX
This file contains hidden or 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
| alias mdcopy="pandoc --from markdown --to html | textutil -convert rtf -stdin -stdout -format html | sed -e \"s/..e2..80..99/'/g\" | pbcopy -Prefer rtf" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The sed command is necessary to fix textutils incorrect copying of apostrophes from html textContent.
Perhaps if the apostrophes were html encoded in the pandoc conversion as
’then this wouldn't be an issue downstream in textutil.