【问题标题】:The end of the string was reached with no closing bracket found: NodeJS & Jade到达字符串末尾但未找到右括号:NodeJS & Jade
【发布时间】:2013-09-18 05:11:42
【问题描述】:

我开始了我的节点之旅(遵循rolling with mongo 教程),并编写了以下玉文件

extends layout
block content
  h1= title
  form( method="post")
    div
      div
        span Title :
        input(type="text", name="title", id="editArticleTitle")
      div
        span Body :
        textarea(name="body", rows=20, id="editArticleBody)// <--- This line!
      div#editArticleSubmit
        input(type="submit", value="Send")

我从玉字符解析器中得到The end of the string was reached with no closing bracket found.。它归咎于上面代码中指向的行。我当然有可能遗漏了一个括号,但我没有看到它可能在哪里。

这是堆栈跟踪:

The end of the string was reached with no closing bracket found.
    at Function.parseMax (/home/me/Documents/node/blog/node_modules/jade/node_modules/character-parser/index.js:26:13)
    at Object.Lexer.bracketExpression (/home/me/Documents/node/blog/node_modules/jade/lib/lexer.js:138:33)
    at Object.Lexer.attrs (/home/me/Documents/node/blog/node_modules/jade/lib/lexer.js:524:24)
    at Object.Lexer.next (/home/me/Documents/node/blog/node_modules/jade/lib/lexer.js:788:15)
    at Object.Lexer.lookahead (/home/me/Documents/node/blog/node_modules/jade/lib/lexer.js:122:46)
    at Object.Parser.lookahead (/home/me/Documents/node/blog/node_modules/jade/lib/parser.js:116:23)
    at Object.Parser.parseTag (/home/me/Documents/node/blog/node_modules/jade/lib/parser.js:618:25)
    at Object.Parser.parseExpr (/home/me/Documents/node/blog/node_modules/jade/lib/parser.js:199:21)
    at Object.Parser.block (/home/me/Documents/node/blog/node_modules/jade/lib/parser.js:593:25)
    at Object.Parser.tag (/home/me/Documents/node/blog/node_modules/jade/lib/parser.js:722:26)

【问题讨论】:

  • textarea(name="body", rows=20, id="editArticleBody) 您在id 属性上缺少一个结束双引号。 id="editArticleBody"
  • ARG!我需要一些语法高亮。
  • 如果错误给你一个行号会更酷:-)

标签: javascript node.js parsing express pug


【解决方案1】:

已经很晚了。我错过了结束语

【讨论】:

  • 我的更好。我使用的是 Visual Studio Code,它显然有一个方便的功能,它偶尔会以非常微妙的方式克隆您正在处理的文件,以便您开始进行克隆。
猜你喜欢
  • 2020-09-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多