-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout + html safe extension #87
Comments
@benmccallum I moved your last comment to a new issue. Please drop a line if the problem is solved or not. |
Thanks @adoconnection , sorry for piling on another issue :P I've resolved my issue, but should we get my gist into a sample app or documentation so this combo is clear to setup for folks? |
Gosh, sorry I'm not sure how I missed the extensions part of the readme which points to: https://github.com/wdcossey/RazorEngineCore.Extensions Perhaps I should've just used that all along 🤦🏻♂️ |
No worries |
Feel free to close this if you'd prefer to point to the other package. Here's my gist again for anyone it helps. |
👌👌 |
@adoconnection , I seem to have a problem after following the layout + html safe templating docs whereby the
@RenderBody()
portion is html encoded... any suggestions?It's like it's encoding the
@RenderBody()
part when it's already safe/encoded.Edit:
I think I have a solution, shout out if I'm missing any issues though.
MyTemplateBase<T>
Include and RenderBody methods to returnobject
and be virtual.MyHtmlTemplateBase<T>
(which inheritsMyTemplateBase<T>
) by overriding those two methods and have themreturn Raw(base.Include/RenderBody);
.internal class
as it was previously private inside MyTemplateBase.Like this, when
WriteAsync
is called with the RenderBody() or Include() result, it's already aRawContent
and the avoidance of html encoding happens.Hope that helps someone else. Almost wonder if it's worth adding this into the docs.
Originally posted by @benmccallum in #65 (comment)
The text was updated successfully, but these errors were encountered: