I am trying to output some HTML video tags park of which include
<source src="${Model.WebMFilename}" type='video/webm; codecs="vp8, vorbis"' />
However in the browser this renders as
<source vorbis""="" vp8,="" type="video/webm; codecs=" src="VP8_645001.webm"></source>
Any idea how I stop Sparkview reformatting the output?
I managed to get the desired output by wrapping the single quote !{"'"} so
Rendered
Are you sure about your output? I ran this exact scenario through a unit test in the source code and I got the following:
Input:
Result:
This looks like a "feature" in Spark is getting in the way here, and this is becoming more prevalent with client side frameworks, json popularity and HTML5 attributes usage.
The "feature" I speak of is that Spark can read your input and you can have single or double quotes surrounding your attributes and it will understand the value inside the attribute without an issue, but there is a current side effect of view compilation that automatically (and incorrectly) replaces the surrounding attributes with double quote instead of the quote type you actually used.
I am currently working on a fix for this in the source code. In the mean time, you could try and place your double quotes on the outside of the attribute and try single quotes on the inside although I know this does break some of the client side frameworks since they don't expect that. Can you try this instead (Note: single quote on the inside):
Hope that helps,
Rob