Last active
September 22, 2015 15:47
-
-
Save johnbhartley/c70a72b829856705057f to your computer and use it in GitHub Desktop.
A quick little way to update HTML code to have all self-closing elements have a trailing slash in Sublime Text 3
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
# find all image elements replace the end with a trailing slash | |
find: <img(.*?)> | |
replace: <img\1 /> | |
# find all input elements replace the end with a trailing slash | |
find: <input(.*?)> | |
replace: <input\1 /> | |
# take all instances where extra / was made and trash it | |
find: / /> | |
replace: /> | |
# saves all the files in case there | |
# is an unbearable amount to save manually | |
Opt + Cmd + S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment