Skip to content
New issue

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

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

Already on GitHub? # to your account

How to keep the data in multi-line configuration #54

Closed
ssz1025 opened this issue Oct 31, 2024 · 2 comments
Closed

How to keep the data in multi-line configuration #54

ssz1025 opened this issue Oct 31, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@ssz1025
Copy link

ssz1025 commented Oct 31, 2024

image
image

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$host" ';

My original nginx configuration is multi-line, and after parsing it, it becomes one line. How to keep the data in multi-line configuration;
Note: The spaces and line breaks I use are\t \n

@tufanbarisyildirim tufanbarisyildirim added the good first issue Good for newcomers label Nov 1, 2024
@mofantor
Copy link
Contributor

regarding this request, I have already submitted a PR:
#54 Keep parameters in their relative lines when in multi-line configuration.
check it out

@tufanbarisyildirim
Copy link
Owner

thanks @mofantor , let's polish it and we merge

tufanbarisyildirim pushed a commit that referenced this issue Dec 20, 2024
…uration. (#61)

* 1. Migrate all directive parameters to the Parameter object
2. The Parameter object stores the relative line index to the directive, allowing the dump to retain the original layout
3. During parsing, obtain and store the relative line index of parameters to the directive
4. During dump, restore the original relative line index

* fix: resolve linter warnings in statement.go
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants