此模板:
h1 Editing #{product.name}
form(action='/products/'+product.id, method='POST')
p
label(for='product_name')
Name:
input(type='text', id='product_name', name='product[name]', value=product.name)
p
label(for='product_description')
Description:
input(id='product_name', name='product[description]')= product.description
p
input(type='submit')
给了我这个错误:
Error: /home/alex/apps/express2/views/products/edit.jade:10
8| Description:
9| p
> 10|
unexpected token "eos"
at Object.parseExpr (/home/alex/node_modules/jade/lib/parser.js:222:15)
at Object.block (/home/alex/node_modules/jade/lib/parser.js:521:25)
at Object.parseTag (/home/alex/node_modules/jade/lib/parser.js:612:26)
at Object.parseExpr (/home/alex/node_modules/jade/lib/parser.js:188:21)
at Object.block (/home/alex/node_modules/jade/lib/parser.js:521:25)
at Object.parseTag (/home/alex/node_modules/jade/lib/parser.js:612:26)
at Object.parseExpr (/home/alex/node_modules/jade/lib/parser.js:188:21)
at Object.parse (/home/alex/node_modules/jade/lib/parser.js:129:25)
at parse (/home/alex/node_modules/jade/lib/jade.js:101:62)
at Object.compile (/home/alex/node_modules/jade/lib/jade.js:148:9)
有任何解决此问题的建议吗?
答案 0 :(得分:1)
在名称和描述后转义冒号 所以它会 名称\:和说明\:
似乎冒号具有特殊含义并由玉石解析