fix #4607 - scripts added twice

This commit is contained in:
sbwalker 2024-09-16 13:21:43 -04:00
parent f2c854b53a
commit 1f2e2148d5
2 changed files with 2 additions and 3 deletions

View File

@ -44,7 +44,6 @@
} }
// head content // head content
AddHeadContent(headcontent, PageState.Site.HeadContent);
if (!string.IsNullOrEmpty(PageState.Site.HeadContent)) if (!string.IsNullOrEmpty(PageState.Site.HeadContent))
{ {
headcontent = AddHeadContent(headcontent, PageState.Site.HeadContent); headcontent = AddHeadContent(headcontent, PageState.Site.HeadContent);

View File

@ -534,9 +534,9 @@
private string ParseScripts(string content) private string ParseScripts(string content)
{ {
// iterate scripts
var scripts = ""; var scripts = "";
if (!string.IsNullOrEmpty(content)) // in interactive render mode, parse scripts from content and inject into page
if (_renderMode == RenderModes.Interactive && !string.IsNullOrEmpty(content))
{ {
var index = content.IndexOf("<script"); var index = content.IndexOf("<script");
while (index >= 0) while (index >= 0)