- Changing HtmlHelper and HelperResult to implement IHtmlContent.
- Introducing BufferedHtmlContent.
- Making RazorPage handle only IHtmlContent and clearing out other types.
- Making StringCollectionTextWriter use BufferedHtmlContent so that it can be returned where necessary.
- Updating places which involve Write/Copy to pass in encoders.
- The encoders are currently not being used during write. But when HtmlString is modified to carry encode metadata, the encoder can be used for writing. This is a perf optimization and hence not a part of this change.
- Making TagHelperContent implement IHtmlContent.
Html.PartialAsync
* Introducing StringCollectionTextWriter to buffer the contents of
PartialAsync
* Ensure DecorateWriter is called for partial views
Fixes#1266
RazorTextWriter represents the result of rendering a page as a sequence of
strings rather than a concatenated string. This avoids building up large
strings in memory.