atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

Handle unindented empty lines in text block #16

Closed tgwizard closed 10 years ago

tgwizard commented 10 years ago

Handle text blocks properly. As can be seen here, the GitHub renderer correctly marks the content: | text block as a block:

#cloud-config

coreos:
  etcd:
    # generate a new token for each unique cluster from https://discovery.etcd.io/new
    # WARNING: replace each time you 'vagrant destroy'
    #discovery: https://discovery.etcd.io/<token>
    addr: $public_ipv4:4001
    peer-addr: $public_ipv4:7001
  fleet:
    public-ip: $public_ipv4
  units:
    - name: etcd.service
      command: start
    - name: fleet.service
      command: start
    - name: docker-tcp.socket
      command: start
      enable: true
      content: |
        [Unit]
        Description=Docker Socket for the API

        [Socket]
        ListenStream=2375
        Service=docker.service
        BindIPv6Only=both

        [Install]
        WantedBy=sockets.target
      hi:

language-yaml doesn't handle this properly:

Old

This PR changes it to be correct:

Fixed

The correct "AST" can be viewed here: http://yaml-online-parser.appspot.com/

kevinsawicki commented 10 years ago

Great, thanks so much for fixing this.