Skip to content

Partials don't work with Jade #30

@jimpo

Description

@jimpo

jade.render has the signature of an asynchronous function, using a callback instead of returning the rendered HTML. Line 297 of index.js assumes that jade.render will return HTML. My hack to get this to work is (in Coffeescript):

partials.register '.jade', (str, options) ->
  tmpl = null
  jade.render(str, options, (err, value) ->
    throw err if err?
    tmpl = value
  )
  return tmpl

This only works because jade.render actually renders the template synchronously so there's no race condition, but this is super ugly and could break in future versions of Jade if jade.render actual becomes asychronous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions