Skip to content

Instantly share code, notes, and snippets.

@cap10morgan
Created March 3, 2015 17:14
Show Gist options
  • Save cap10morgan/03a7c61dfe6f389b4471 to your computer and use it in GitHub Desktop.
Save cap10morgan/03a7c61dfe6f389b4471 to your computer and use it in GitHub Desktop.
hbs bug
(ns hbs-test.core
(:require [hbs.core :refer :all]
[hbs.helper :refer :all])
(:gen-class))
(def broken-template
"Hello, World!
{{#parent}}
{{child}} says hi too.
{{/parent}}")
(def working-template
"Hello, World!
{{#with parent}}
{{child}} says hi too.
{{/with}}")
(defn render-template
[template]
(render template
{:parent {:child "The kid"}}))
(defn -main
[& args]
(println "Broken template:\n\n" (render-template broken-template))
(println "Working template:\n\n" (render-template working-template)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment