ghodss/yaml

yamltojson got wrong output format

glepnir opened this issue · 0 comments

I have this yaml

- repo: mhinz/vim-startify
  hook_add: source  $VIM_PATH/modules/module-startify.vim
  hook_post_source: |
      function! StartifyEntryFormat()
        return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path'
      endfunction
- repo: neoclide/coc.nvim
  merge: 0
  build: 'yarn install --frozen-lockfile'
  hook_add: source  $VIM_PATH/modules/module-coc.vim

use yamltojson function, i got this output format

[{"hook_add":"source  $VIM_PATH/modules/module-startify.vim","hook_post_source":"function! StartifyEntryFormat()\n  return 'WebDevIcons
GetFileTypeSymbol(absolute_path) .\" \". entry_path'\nendfunction\n","repo":"mhinz/vim-startify"},{"build":"yarn install --frozen-lockf
ile","hook_add":"source  $VIM_PATH/modules/module-coc.vim","merge":0,"repo":"neoclide/coc.nvim"}]

it should be

[{"repo":"mhinz/vim-startify","hook_add":"source  $VIM_PATH/modules/module-startify.vim",
"hook_post_source ":"  function! StartifyEntryFormat()\n return'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path'\n endfunction\n"},
{"repo":"neoclide/coc.nvim","merge":0,"build":"yarn install --frozen-lockfile","hook_add":
"$VIM_PATH/modules/module-coc.vim"}]