bronze1man / yaml2json

a command line tool convert from yaml to json
MIT License
226 stars 45 forks source link

yaml2json misses underscores in certain strings #12

Closed astefanova closed 6 years ago

astefanova commented 6 years ago

It seems the issue is only reproducible for certain strings. The pattern \<number>\<string>\<underscore>\<number> is faulty. There may be more.

See:

$ cat file.yml
---
property: 0testS_1value
###
$ cat file.yml | yaml2json
{"property":"0testS1value"}
bronze1man commented 6 years ago

Thanks for your small test data. It is come from the library of yaml https://github.com/go-yaml/yaml I have checked that the master version of https://github.com/go-yaml/yaml do not have this bug.

bronze1man commented 6 years ago

This issues is fixed and add a test to ensure it will be fixed in the future. Thanks for your report again.

https://github.com/bronze1man/yaml2json/blob/master/y2jLib/lib_test.go#L24