flyx / emerald

HTML5 templating engine for Nimrod
Do What The F*ck You Want To Public License
95 stars 9 forks source link

Using call_mixin inside child template results in SIGSEGV #21

Open konradmb opened 5 years ago

konradmb commented 5 years ago
import emerald
proc mySection(title: string) {.html_mixin.} =
    section:
        h1: title
        put mixin_content()

proc parent() {.html_templ.}=
  block content: 
    h1: "Content:"

proc templ(numItems: int) {.html_templ: parent.} =
  append content:
    html(lang="en"):
        body:
            call_mixin mySection("First section"):
                p: "Content"
            call_mixin mySection("Second section"):
                p: "More content"

Result:

SIGSEGV: Illegal storage access. (Attempt to read from nil?)