Hello, this will be fixed in our update later today. Thanks for your patience!
Edit: just as a clarification.. the preview on the lister page cannot change your template code. The problem here is that the Text Editor on the create/edit custom template page is actually acting like the Design Editor and corrupting code. The fix today should make it behave like a regular Text Editor