How to trim zero or more leading and trailing spaces from key-value pairs?

@Christian_Dahlqvist the gsub regex is not removing spaces around =.

shot