rgrinberg/ocaml-mustache

Nested sections fail to parse

seliopou opened this issue · 1 comments

I came across this while trying to write the following template fragment:

{{#scripts}}
<script src="{{& src}}" {{#charset}}charset="{{& charset}}">{{/charset}}</script>
{{/scripts}}

Attempting to parse this resulted in the following exception:

Mustache_types.Invalid_template("Mismatched section charset with scripts")

Example JSON:

{
  "scripts" : [
    {
      "src" : "d3.js",
      "charset" : "utf-8"
     }
  ] 
}

This is invalid. Thought I was testing one file but I was testing another that had a syntax error.