Fix editor parsing templates.

Fixes #4247.