Hello I have this code in my `ASP.NET Razor v2 cshtml` file that should load `string` into this paragraph the variable is from `c# list of strings` but when the `string` that is loaded contains something like this:
+ "<p>"+'Rejvízská 113 79001 Jeseník'+"</p>"
I get this JavaScript critical error: `SCRIPT1015: Unterminated string constant`
The program fails because some character escaped my `ending quotation mar` `'`
Actually the code looks like this:
"<p>"+'@string.Format(serviceDescription[i])'+"</p>"
serviceDescription is list of strings that may containt whatever value that can escape my `'` character.
May I please know how to correct this?
This code is used in adjusting `InfoWindow in Google API`
So far I tried and non of these method worked:
+ "<p>"+' @string.Format("<p>{0}</p>", serviceDescription[i])'+"</p>"
+ "<p>"+'@string.Format(serviceDescription[i])'+"</p>"
+ "<p>"+'@string.Format("{0}", @Html.Raw(serviceDescription[i]))'+"</p>"
+ "<p>"+' @(new HtmlString(serviceDescription[i]))'+"</p>"
+ "<p>"+' @Html.Raw(serviceDescription[i])'+"</p>"
+ ' @Html.Raw("<p>"+@serviceDescription[i]+"</p>")'
+ @(new HtmlString("<p>"+serviceDescription[i]+"</p>"))