Html Uexpected token';标签';jade node.js

Html Uexpected token';标签';jade node.js,html,node.js,pug,Html,Node.js,Pug,我得到: 由于该代码: Unexpected token 'tag' expected 'text', 'code', ':', 'newline' or 'eos' 在 为什么?:) 试试这个: #main form(action="/raspored" method=post) label(for="polaziste")Polaziste input(type="list" id="polaziste") datalist#

我得到:

由于该代码:

    Unexpected token 'tag' expected 'text', 'code', ':', 'newline' or 'eos'

为什么?:)

试试这个:

#main
    form(action="/raspored" method=post)
        label(for="polaziste")Polaziste
        input(type="list" id="polaziste")
        datalist#polaziste
            for pol,i in popis
                option(value = pol)

请注意Polaziste之前的空格。

对于其他访问,错误使用jade API时也会出现此错误

根据文件

var fn=jade.compile('string of jade',options)

但是,如果您意外地将其解释为

var fn=jade.compile('/path/to/file.jade',options)


您将有问题。:)

)谢谢。在jade中,在标签之间写东西是一个普遍的规则吗?模板是这样的,虽然非常有用,但它们要求你遵守一些规则——否则,很难解释我们要求它做什么。顺便说一句,polaziste是什么意思?它在克罗地亚语中的意思是“起点”。在这种情况下,它的意思是“火车离开的地方”。它实际上是“polazište”,但我有点习惯于在编码时省略字母表中的所有非标准字符。保留非标准字符,有些语言没有它们是无法书写的,比如西班牙语或法语,如果没有它们,用户会感到不舒服。新的字符编码应该尊重它们(至少对于所有的拉丁字符集),另外,在
type=“list”
#main
    form(action="/raspored" method=post)
        label(for="polaziste")Polaziste
        input(type="list" id="polaziste")
        datalist#polaziste
            for pol,i in popis
                option(value = pol)
label(for="polaziste") Polaziste