Skip to content

Instantly share code, notes, and snippets.

@xanderificnl
Created January 23, 2022 00:26
Show Gist options
  • Save xanderificnl/e31ac304a0e70cccb782d58fce3277cd to your computer and use it in GitHub Desktop.
Save xanderificnl/e31ac304a0e70cccb782d58fce3277cd to your computer and use it in GitHub Desktop.
Convert slim files to haml without Temple functions
# 0. Make a backup first.
# 1. Install slim2haml
gem install slim2haml
# 2. Use the line below to remove offending lines.
for i in $(find . -name '*.haml'); do sed -E 's/::Temple::Utils\.escape_html((.*))/\1/; s/\(\(//g; s/\)\)//g; s/(-|=) _slim_controls[[:digit:]] ?//g' -i "$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment