blob: d2b47cc20b71f12a2460ab451350e6dc88b9dbf3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
var path = require('path')
var render = require('./render')
module.exports = function renderTo (file, elem, cb) {
render(file, function (tagName) {
if (elem.nodeName !== tagName.toUpperCase()) {
var extname = path.extname(file.name).toLowerCase()
throw new Error(
'Cannot render "' + extname + '" inside a "' +
elem.nodeName.toLowerCase() + '" element, expected "' + tagName + '"'
)
}
return elem
}, cb)
}
|