Skip to content

Cannot make TSynMustache.Render emit unescaped html or Partials #221

@fastbike

Description

@fastbike

The various Render methods on the TSynMustache class contain an EscapeInvert parameter to turn off html escaping.
However this is not used by the default TMVCMustacheViewEngine class, so all html is escaped
e.g. "
" becomes "<br>" and so is thus rendered as "
" in the browser rather than as a line break.

I have not yet come up with a fix, as the TMVCMustacheViewEngine descends from TMVCBaseViewEngine and there does not appear to be an easy way to add the extra "EScapeInvert" param to the Execute method.
And as the TMVCController.GetRenderedView method that calls the Execute method, also creates the instance of the ViewEngine via the ViewEngineClass type, the constructor cannot be altered to add an "EscapeInvert" parameter.

Am I missing something ?

Metadata

Metadata

Labels

acceptedIssue has been accepted and inserted in a future milestoneenhancement

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions