options.go
func InitializeOptions(opts *Options) *Options {
	if opts == nil {
		opts = &Options{}
	}

	if opts.Extension == "" {
		opts.Extension = defaultExtension
	}

	if opts.DelimLeft == "" {
		opts.DelimLeft = defaultDelimLeft
	}

	if opts.DelimRight == "" {
		opts.DelimRight = defaultDelimRight
	}

	if opts.AttributeNameClass == "" {
		opts.AttributeNameClass = defaultAttributeNameClass
	}
	if opts.NoCloseTagNames == nil {
		opts.NoCloseTagNames = make([]string, len(defaultNoCloseTagNames))
		copy(opts.NoCloseTagNames, defaultNoCloseTagNames)
	}

	if opts.Indent != "" {
		opts.formatter = newFormatter(opts.Indent)
	}

	return opts
}
func InitializeOptions(opts *Options) *Options {
	if opts == nil {
		opts = &Options{}
	}

	if opts.Extension == "" {
		opts.Extension = defaultExtension
	}

	if opts.DelimLeft == "" {
		opts.DelimLeft = defaultDelimLeft
	}

	if opts.DelimRight == "" {
		opts.DelimRight = defaultDelimRight
	}

	if opts.AttributeNameClass == "" {
		opts.AttributeNameClass = defaultAttributeNameClass
	}
	if opts.NoCloseTagNames == nil {
		opts.NoCloseTagNames = make([]string, len(defaultNoCloseTagNames))
		copy(opts.NoCloseTagNames, defaultNoCloseTagNames)
	}

	if opts.Indent != "" {
		opts.formatter = newFormatter(opts.Indent)
	}

	return opts
}
// InitializeOptions initializes the options.