See w:Template_talk:Draft_categories#Functionality_with_VisualEditor.
Topic on VisualEditor/Feedback
Appearance
Ultimately it looks unfeasible for that wikitext hack to be made to work, as you're trying to push page-level meta-data through a template (which is incompatible with the future of templates, of course). Just substitute the template and all will be well?