nginxinc / crossplane

Quick and reliable way to convert NGINX configurations into JSON and back.
Apache License 2.0
719 stars 87 forks source link

Arguments escape not uniform #96

Open faceair opened 3 years ago

faceair commented 3 years ago

Describe the bug

After the crossplane parse, I expect all arguments to be unescaped.

https://github.com/nginxinc/crossplane/blob/v0.5.7/tests/test_parse.py#L946 Here, arg1 is escaped, but arg2 is unescaped, where the data format is not uniform. My program is confused when dealing with the arguments of the directive and doesn't know when it should be manually unescape.

Expected behavior

'args': ['#arg 1', '#arg 2']
faceair commented 3 years ago

https://github.com/faceair/nginx-parser/blob/171aa974ea5218140032e13872840359a1033162/parser_test.go#L84 I wrote a parser myself to solve this problem.