Consistent spaceless nodes in form templates

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Added '-' at the start and at the end of all if, for, set and block nodes. Related to #12422.