Skip to content

Instantly share code, notes, and snippets.

@johnbhartley johnbhartley/st3-fnr-xhtml
Last active Sep 22, 2015

Embed
What would you like to do?
A quick little way to update HTML code to have all self-closing elements have a trailing slash in Sublime Text 3
# 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
You can’t perform that action at this time.