Fix editor parsing templates. Fixes #4247.
Merge pull request #4260 from pchote/editor-fix

Fix editor parsing templates.