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

Commit 142be2a

Browse files
author
Jérémie Bertrand
committed
Fix #293
Smelly code, but I don't have time to refactor Pretzel entirely for now.
1 parent ad62fa1 commit 142be2a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Pretzel.Logic/Templating/Razor/RazorSiteEngine.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected override void PreProcess()
3535
{
3636
_allTags.AddRange(Tags);
3737
}
38-
38+
3939
if (TagFactories != null)
4040
{
4141
_allTags.AddRange(TagFactories.Select(factory =>
@@ -66,9 +66,14 @@ protected override string RenderTemplate(string content, PageContext pageData)
6666

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

69+
var pageContent = pageData.Content;
70+
pageData.Content = pageData.FullContent;
71+
6972
try
7073
{
71-
return Engine.Razor.RunCompile(content, pageData.Page.File, typeof(PageContext), pageData);
74+
content = Engine.Razor.RunCompile(content, pageData.Page.File, typeof(PageContext), pageData);
75+
pageData.Content = pageContent;
76+
return content;
7277
}
7378
catch (Exception e)
7479
{

0 commit comments

Comments
 (0)