From a9b0f8ae9a75b24c29e907e0796dd401754c100b Mon Sep 17 00:00:00 2001 From: Frans Bouma Date: Thu, 11 Feb 2016 18:50:08 +0100 Subject: [PATCH] FIX: if a template marker was present in the content it got replaced as well --- src/SimpleNavigationElement.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SimpleNavigationElement.cs b/src/SimpleNavigationElement.cs index 59d02e6..436838e 100644 --- a/src/SimpleNavigationElement.cs +++ b/src/SimpleNavigationElement.cs @@ -103,7 +103,6 @@ namespace Docnet sb.Replace("{{Name}}", activeConfig.Name); sb.Replace("{{Footer}}", activeConfig.Footer); sb.Replace("{{TopicTitle}}", this.Name); - sb.Replace("{{Content}}", content); var relativePathToRoot = Utils.MakeRelativePath(Path.GetDirectoryName(destinationFile), activeConfig.Destination).Replace(@"\", @"/"); sb.Replace("{{Path}}", relativePathToRoot); sb.Replace("{{Breadcrumbs}}", activePath.CreateBreadCrumbsHTML(relativePathToRoot)); @@ -112,6 +111,9 @@ namespace Docnet { sb.Replace("{{ExtraScript}}", this.ExtraScriptProducerFunc(this)); } + + // the last action has to be replacing the content marker, so markers in the content which we have in the template as well aren't replaced + sb.Replace("{{Content}}", content); Utils.CreateFoldersIfRequired(destinationFile); File.WriteAllText(destinationFile, sb.ToString()); if(!this.IsIndexElement)