为什么这不是YAML?

bro*_*son 1 ruby yaml ruby-on-rails

我无法弄清楚为什么这个代码会在rails YAML解析器中运行.

sections:
  [
    {title: "Journal Entry Testing",
     procedures:
       ["Select a sample of journal entries prepared during the year and determine if they were prepared correctly and approved.”]
    }    
  ]
Run Code Online (Sandbox Code Playgroud)

Dav*_*ton 6

由于不匹配的双引号,放大以突出差异:

["选择样品......并批准."]

看看结尾引号是如何"智能"引用的?

通过这个修复,它通过http://yamllint.com/,并变成实际的YAML.