trivago/melody

Nonbreaking space in template leads to hard-to-understand error message

開放

#85 建立於 2019年1月10日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (37 個分叉)auto 404
buggood first issue

倉庫指標

星標
 (216 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Explain the problem

When there is a nonbreaking space (unicode character code 160) in a template, the Melody parser will output an "Unknown token" error message. In the console, this usually looks like a normal space, this is why it's confusing.

Expected Behaviour

It might be good to test explicitly for the nonbreaking space, and inform the developer-user of it.

Actual Behaviour

"Unknown token" with the arrow pointing to what looks like a normal space. nbsp-error

Steps to reproduce

Insert a nonbreaking space in any template and try to compile it.

Provide a repository that reproduces issue if possible

Provide your Environment details

  • Node version:

  • Operating System:

  • melody version:

貢獻者指南