Steps:
* Load an MVC 4 project.
* Go into a view (e.g., ~/Views/Shared/_Layout.cshtml).
* Add an attribute to an HTML element and make its value something that is already attribute-encoded and wrapped in `@Html.Raw`.
* Run site and find the title attribute is encoded, despite being run through `@Html.Raw`.
Example:
<a title="@Html.Raw("Show Size 6½-8")">Test1</a>
Expected:
<a title="Show Size 6½-8">Test1</a>
Actual (doubly-encoded somehow):
<a title="Show Size 6&#189;-8">Test1</a>
[Original Stack Overflow question: http://stackoverflow.com/q/12321616/48700]
Comments: Yep, there's a bug here. I've got patched WebViewPage base classes here: https://gist.github.com/4036121 which can help work-around the problem. We'll put it on our queue for the next release!
* Load an MVC 4 project.
* Go into a view (e.g., ~/Views/Shared/_Layout.cshtml).
* Add an attribute to an HTML element and make its value something that is already attribute-encoded and wrapped in `@Html.Raw`.
* Run site and find the title attribute is encoded, despite being run through `@Html.Raw`.
Example:
<a title="@Html.Raw("Show Size 6½-8")">Test1</a>
Expected:
<a title="Show Size 6½-8">Test1</a>
Actual (doubly-encoded somehow):
<a title="Show Size 6&#189;-8">Test1</a>
[Original Stack Overflow question: http://stackoverflow.com/q/12321616/48700]
Comments: Yep, there's a bug here. I've got patched WebViewPage base classes here: https://gist.github.com/4036121 which can help work-around the problem. We'll put it on our queue for the next release!