umbraco / UmbracoDocs

The official Umbraco Documentation
https://docs.umbraco.com
MIT License
266 stars 770 forks source link

HtmlString vs IHtmlEncodedString #3573

Closed Myster closed 2 years ago

Myster commented 2 years ago

This is the page with issues: https://github.com/umbraco/UmbracoDocs/edit/main/Reference/Templating/Modelsbuilder/Introduction.md

This page shows that a modelsbuilder class with a property that is IHtmlEncodedString will output without the use of Html.Raw or without the use of new HtmlString(modelsBuilderObject.PropertyName.ToHtmlString())

This is not my experience, if I don't do one of these things the HTML is escaped and I see markup on my rendered page.

I would prefer modelsbuilder to produce HtmlString properties rather than using a proprietary IHtmlEncodedString which I don't understand. (perhaps this should be a bug report, not a documentation change.)

jonat123 commented 2 years ago

@Myster thanks for making this issue 😊

To be honest i am not sure 🤔

I think that this might fit more as an issue on the issue tracker for the CMS, rather than here in the documentation 🙂

jonat123 commented 2 years ago

Hey, @Myster I will close this issue down as it seems to be more of a CMS issue than a docs issue as mentioned in my above comment I would recommend creating it on the CMS tracker :-)

Have a great day!