Minimal example below.
MainView.cshtml:
@helper RenderSomething()
{
<div>@RenderPartial("PartialView")</div>
}
<html><body>@RenderSomething()</body></html>
PartialView.cshtml:
<table><tr><td>Hello World</td></tr></table>
Expected output:
<html><body><div><table><tr><td>Hello World</td></tr></table></div></body></html>
Actual output:
<html><body><div><table><tr><td>Hello World</td></tr></table></div></body></html>
The problem appears to be that RazorTemplateBase.WriteTo is not respecting IHtmlString or RawString. I'll submit a pull request with a fix that worked for me.
Minimal example below.
MainView.cshtml:
@helper RenderSomething(){<div>@RenderPartial("PartialView")</div>}<html><body>@RenderSomething()</body></html>PartialView.cshtml:
<table><tr><td>Hello World</td></tr></table>Expected output:
<html><body><div><table><tr><td>Hello World</td></tr></table></div></body></html>Actual output:
<html><body><div><table><tr><td>Hello World</td></tr></table></div></body></html>The problem appears to be that RazorTemplateBase.WriteTo is not respecting IHtmlString or RawString. I'll submit a pull request with a fix that worked for me.