Visual Studio Content-Type support for <text> in Razor
Currently the <text> placeholder element assumes HTML content in Visual Studio formatting.
The addition of attributes (namely, "type" for Content-Type) to control Visual Studio's parser/formatter in these blocks would be quite useful for templating non-HTML content in template methods.
For example:
@{ object template = @<text type="text/css">
.foo { background-image: url("foo.png"); }
.bar { background-image: url("bar.png"); }
</text>; }
The type attribute in this case would enforce formatting of the template contents as CSS.
1 comment
-
Dan
commented
Addendum: This is strictly intended as a hook for the Visual Studio parser, with no impact on the processing of Razor templates. If, however, someone sees value in supplementing the Razor parser with support for this meta-data, such that it could impact the page processing, then I think that's darn cool :)