An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
Comments: PR here: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3861
Comments: PR here: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3861