I fixed the problem in Element by using a computed property to remove whitespace on set var _content: String = "" var content: String { get { return _content } set (newValue){ _content = newValue.trimmingCharacters(in: .whitespacesAndNewlines) } }
I fixed the problem in Element by using a computed property to remove whitespace on set
var _content: String = ""
var content: String {
get {
return _content
}
set (newValue){
_content = newValue.trimmingCharacters(in: .whitespacesAndNewlines)
}
}