5
Vote

Improvement: @"..."@ or @'...'@ as alias for <text>...</text>

description

In order to to use razor to generate "non-XML-like languages" without using <text> tags
as a softwaredevelopper
i want @"..."@ or @'...'@ as alias for <text>...</text>
 
From http://stackoverflow.com/questions/4938134/use-razor-to-generate-code
 
> You certainly could use Razor to generate C# code, 
> but it's not really designed for non-XML-like languages. 
> You'd have to have a lot of <text> tags.
 
I implemented a small working example http://stackoverflow.com/questions/4938134/use-razor-to-generate-code/5376539#5376539
and thought that @"..."@ or @'...'@ as alias for <text>...</text> would make the code much more clear

comments

BuildStarted wrote Mar 21, 2011 at 3:18 PM

I'll have to look into the parser and see if there is a mechanism for that. Also, consider that the parser is actually a separate project at http://aspnet.codeplex.com so even if it were possible - code changes to future versions might break it. Currently the parser only looks for the xml tag of "text" and as such changing it to something else doesn't work straight off the bat. (Especially considering that @ is supposed to be a transition to code.

I'm not saying it's not going to work but I don't think the parser works in the way you intend it to. :)

With that said, I will look into it.