Skip to content

Instantly share code, notes, and snippets.

@billdozr
Created August 2, 2011 08:43
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/1119832 to your computer and use it in GitHub Desktop.
Save billdozr/1119832 to your computer and use it in GitHub Desktop.
(defn preview-essay-body []
(let [body-el (dom/getElement "body_id")
preview-el (dom/getElement "preview_pane")
b-txt (.value body-el)
safe "false"]
(dom/removeChildren preview-el)
(dom/appendChild
preview-el
(dom/htmlToDocumentFragment
(js* "new Showdown.converter().makeHtml(~{b-txt},~{safe})")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment