options.go 759 B

123456789101112131415161718192021222324252627
  1. package premailer
  2. // Options for controlling behaviour
  3. type Options struct {
  4. // Remove class attribute from element
  5. // Default false
  6. RemoveClasses bool
  7. // Copy related CSS properties into HTML attributes (e.g. background-color to bgcolor)
  8. // Default true
  9. CssToAttributes bool
  10. // If true, then style declarations that have "!important" will keep the "!important" in the final
  11. // style attribute
  12. // Example:
  13. // <style>p { width: 100% !important }</style><p>Text</p>
  14. // gives
  15. // <p style="width: 100% !important">Text</p>
  16. KeepBangImportant bool
  17. }
  18. // NewOptions return an Options instance with default value
  19. func NewOptions() *Options {
  20. options := &Options{}
  21. options.CssToAttributes = true
  22. options.KeepBangImportant = false
  23. return options
  24. }