Created
August 2, 2011 08:43
-
-
Save billdozr/1119832 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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