You can use regex to replace leading and trailing spaces with nothing.
Inside the tag, you can open the text area and use the replace(...) function to replace the start and end spaces:
text() { replace(/^\s+|\s+$/, "") }
Here is a working example in play.tritium.io:
http://play.tritium.io/648c6b2f72266b7b7db308e14dcb85f71707f4ee
source share