I have a markdown file in UTF-8 without BOM encoding format[md file generated tool from word document] . Converted this markdown to HTML using jekyll tool. The following special characters available(apostrophe,hypen so on) in md file content .
1.example content in MD:
dont't, **ListView** control
Converted HTMl format like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>dont’t, <strong>ListView</strong> control</p>
</body>
</html>
We can get exact result dont’t, ListView control
when open the html file. I want to use the same html file loaded in to ASP.NET MVC razor view through Html.Action. syntax given below
MVC Razor view access the html file via action method:
Html.Action("GetHtmlPage", "Products", new {path = "~/Views/Products/WhatsNew/" + Model.Platform + ".html"}))
Action code:
public ActionResult GetHtmlPage(string path)
{
return new FilePathResult(path, "text/html");
}
Using the above MVC syntax , i can successfully loaded HTMl file into my View. But the output are show below like in browser and HTMl template like previous format.
dont’t, ListView control
- Apostrope viewed as
'
,’
- Â string added after bold element.
How to view the special characters in browser , when loaded html file into razor view.? I have sticking as long as today.