Coding/BinaryDad.Coding/Views/Home/ViewHtml.cshtml

14 lines
279 B
Plaintext

@model User
@{
Layout = null;
var html = Model.Html;
var htmlTagIndex = Model.Html.IndexOf("<body>");
if (htmlTagIndex > 0)
{
html = html.Insert(htmlTagIndex, $"<head><style type=\"text/css\">{Model.Css}</style></head>");
}
}
@Html.Raw(html)