I'm trying to send multiple chunks of data to a client each of which is rendered by Jade templating engine in Express Node.js framework.
<body>
tag inside to be closed, because more data is to come which should be inside the <body>
tag.</body></html>
tags.Sounds very simple. But the problem is that Jade closes the <html>
and <body>
tags when rendering the header view.
I know how to do this manually using native Node.js response object, however, can't figure out how to do this with Jade the right way.
The only solution I currently see is to manually send the header part down to open <body>
tag, then render the rest as Jade partials via res.partial()
.
Any hint is highly appreciated.
You can output any text (including raw html) with !=
!= "<body>"
some
more
tree(attr=1)
Result in this output:
<body>
<some>
<more>
<tree attr="1"></tree>
</more>
</some>