Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chriskempson/db80633512a1236fd5d3aad3f59a12af to your computer and use it in GitHub Desktop.
Save chriskempson/db80633512a1236fd5d3aad3f59a12af to your computer and use it in GitHub Desktop.
VS Code - Strip Attributes from HTML Tags
# Couldn't figure out how to do /s or get VS Code to search over newlines so came up with this convoluted mess '[\S\s]*?\n?' that matches all characters plus newlines
Search for: <(table|tr|td|p|div|span)[\S\s]*?\n?>
Replace with: <$1>
@joshespi
Copy link

joshespi commented Aug 5, 2022

you just saved me a ton of time. Thank you so much!

@chriskempson
Copy link
Author

@joshespi Glad you found it useful 😄

@dedenhabibi
Copy link

you saved my hope in my project!

@Hosseingsd
Copy link

replace <([a-z][a-z0-9])[^>]?(/?)> with <$1$2>
source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment