Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parses incorrectly multiple lines properties #109

Open
gartz opened this issue Mar 6, 2018 · 0 comments
Open

Parses incorrectly multiple lines properties #109

gartz opened this issue Mar 6, 2018 · 0 comments

Comments

@gartz
Copy link

gartz commented Mar 6, 2018

When using the > to parse multiple lines, the result is invalid, example:

File example:

      NODE_CONFIG: >
        CACHE:
          READWRITE:
            # Whether or not Memcache is disabled. If it is disabled, all of the commands will simply return null as if
            # the key does not exist
            disabled: false

            # The list of hosts to connect to. Can be a string for a single host or an array for multiple hosts. If none
            # provided, defaults to localhost
            hosts:
              - memcached:11211
        LOG:
          WINSTON:
            TRANSPORTS:
              - TYPE: Console
                OPTIONS:
                  level: silly
                  name: console-log
                  handleExceptions: true
                  colorize: false
                  prettyPrint: true
                  timestamp: true

Result:

      NODE_CONFIG: "CACHE:  READWRITE:\n    disabled: false\n\n    hosts:\n      - memcached:11211\nLOG:  WINSTON:\n    TRANSPORTS:\n      - TYPE: Console\n        OPTIONS:\n          level: silly\n          name: console-log\n          handleExceptions: true\n          colorize: false\n          prettyPrint: true\n          timestamp: true\n"

The correct result should be:

      NODE_CONFIG: "CACHE:\n  READWRITE:\n    disabled: false\n\n    hosts:\n      - memcached:11211\nLOG:\n  WINSTON:\n    TRANSPORTS:\n      - TYPE: Console\n        OPTIONS:\n          level: silly\n          name: console-log\n          handleExceptions: true\n          colorize: false\n          prettyPrint: true\n          timestamp: true\n"

It's ignoring the first level breakline and only doing in the next nested levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant