-
Notifications
You must be signed in to change notification settings - Fork 87
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
*_by_lua should unescape the newline "\n" #85
Comments
I have solved it by writing an extra plugin and enabled it in Plugin code in here: https://gist.github.com/Triple-Z/64a0b6ad8fb673d77712e5aabfebfe82 Maybe I can create a PR for this? |
Looks good to me! I would submit a PR, seems like a great use of the extension system to me, although it might be worth considering adding a flag to enable/disable it by the user. |
@gshulegaard I have a WIP PR in here: #86
I will check this and try to do it later~ |
@Triple-Z It's important to make sure that unescaping newlines won't break any embedded lua code, so when you add tests, please include a test that shows that newlines in the lua code that are supposed to be escaped stay escaped. For example if a lua block contains To create a fixture for that test, you can use |
@aluttik Thx & I will check on this :) |
Describe the bug
When I try to use the crossplane, just using
parser
to read a standard NGINX config file and then using thebuild
to convert it back. However, I found that the*_by_lua
directives' newline was replaced by literal\n
. So I think this is a bug for that.To Reproduce
Steps to reproduce the behavior:
parse
andbuild
rewrite_by_lua
has changed.original:
Expected behavior
*_by_lua
directive content can set up a new line for Lua code.Your environment
The text was updated successfully, but these errors were encountered: