I\'m trying to port the old HTML.Image helper, that I\'m sure everyone has used at one point or another, and I\'m having issues. The following compiles fine:
The Razor view engine will automatically HTML-escape strings rendered by @-blocks.
To render actual HTML, you need to write an IHtmlString implementation in the @-block.
Change your method to return HtmlString instead of string.