Horizon.SimpleNginxFormatter (horizon v0.3.4)

View Source

Summary

Functions

Formats an nginx.conf-like string with proper indentation and spacing.

Functions

format(conf)

Formats an nginx.conf-like string with proper indentation and spacing.

Formatting includes:

  • Indenting lines based on '{' and '}'.
  • Inserting a blank line before a line containing '{' unless the previous line is blank or a comment.
  • Inserting a blank line after a line containing '}' unless the next line is also a closing brace ('}').