Skip to content

Instantly share code, notes, and snippets.

@billdozr
Created July 28, 2011 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billdozr/1112594 to your computer and use it in GitHub Desktop.
Save billdozr/1112594 to your computer and use it in GitHub Desktop.
(defn do-build-slug [s]
(if-let [slug-el (dom/getElement "slug_id")]
(.value slug-el (js* "~{s}.replace(/^\\s+|\\s+$/g, '').replace(/[^a-z0-9 -]/g, '').replace(/\\s+/g, '-').replace(/-+/g, '-')"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment