fhd / clostache

{{ mustache }} for Clojure
GNU Lesser General Public License v3.0
318 stars 62 forks source link

Fix rendering of nested partials. Tests added. #19

Closed stanistan closed 12 years ago

stanistan commented 12 years ago

Even though it isn't in the spec, both js and php versions of mustache have this behavior.

(use 'clostache.parser)

(let [template "One {{>two}}"  
      d {}
      partials {:two "Two {{>three}}"
                :three "Three {{>four}}"
                :four "Four {{>five}}"
                :five "Five"}]  
  ;; old behavior
  (render template d partials) ;;=> "One Two"

  ;; new behavior
  (render template d partials)) ;;=> "One Two Three Four Five"
fhd commented 12 years ago

Thanks, merged. I'll make a release once I figured out if this should be a feature or fix release :)