Last active
July 21, 2018 08:11
-
-
Save tonyseek/4fdd46dce284ee8f9d9f20aa58c17b20 to your computer and use it in GitHub Desktop.
Remove wild control characters from files which was edited by VSCode
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
#!/usr/bin/env sh | |
# Clean up the control characters of documents | |
# See also: https://wdd.js.org/vscode-control-characters-problem.html | |
# https://github.com/Microsoft/vscode/issues/37114 | |
exec find . -type f -name '*.md' -exec perl -pi -e 's/[\x{0000}\x{0001}\x{0002}\x{0003}\x{0004}\x{0005}\x{0006}\x{0007}\x{0008}\x{000b}\x{000c}\x{000d}\x{000e}\x{000f}\x{0010}\x{0011}\x{0012}\x{0013}\x{0014}\x{0015}\x{0016}\x{0017}\x{0018}\x{0019}\x{001a}\x{001b}\x{001c}\x{001d}\x{001e}\x{001f}\x{001c}\x{007f}]//gm' {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment