Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Fix #293
Browse files Browse the repository at this point in the history
Smelly code, but I don't have time to refactor Pretzel entirely for now.
  • Loading branch information
Jérémie Bertrand committed Jan 23, 2016
1 parent ad62fa1 commit 142be2a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Pretzel.Logic/Templating/Razor/RazorSiteEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected override void PreProcess()
{
_allTags.AddRange(Tags);
}

if (TagFactories != null)
{
_allTags.AddRange(TagFactories.Select(factory =>
Expand Down Expand Up @@ -66,9 +66,14 @@ protected override string RenderTemplate(string content, PageContext pageData)

content = Regex.Replace(content, "<p>(@model .*?)</p>", "$1");

var pageContent = pageData.Content;
pageData.Content = pageData.FullContent;

try
{
return Engine.Razor.RunCompile(content, pageData.Page.File, typeof(PageContext), pageData);
content = Engine.Razor.RunCompile(content, pageData.Page.File, typeof(PageContext), pageData);
pageData.Content = pageContent;
return content;
}
catch (Exception e)
{
Expand Down

0 comments on commit 142be2a

Please sign in to comment.