【发布时间】:2011-08-28 08:05:45
【问题描述】:
我是 YAML 新手,并尝试执行 YAML 块,但我收到以下错误:
在扫描块映射时:预期,但发现:#(第 8 行,第 1 列)
虽然没有 | 也可以正常工作,但我希望保留空格。
YAML 文件(Home.yml):
---
section:
title: About this site
content: |
This is a test of a test test test test
A very very good test
A test of test test
section:
title: Source code
content: |
Licens:: BSD
Link:: Here
Foo
...
Ruby 代码:
home = YAML.load_file('data/Home.yml')
home.inspect
【问题讨论】: