如果你运行这个 YAML 1.1
- &first {'first': ['description', ['aliases'], ["Explanatory sentences ", "go here."]]}
- *first
- &second 'second':
- 'description'
- ['aliases']
-
- "Explanatory sentences "
- "go here."
- *second
通过YAMLlint,你得到这个:
---
-
first:
- description
-
- aliases
-
- "Explanatory sentences "
- "go here."
-
first:
- description
-
- aliases
-
- "Explanatory sentences "
- "go here."
-
second:
- description
-
- aliases
-
- "Explanatory sentences "
- "go here."
- second
请注意,该first
组重复两次,而该second
组仅完整显示一次,仅显示重复块应位于的名称。first
组和组的second
数据完全相同——唯一的区别是布局。为什么别名不适用于second
组?