From 4cefffe568ed50da0debf367e07a46e4142f1b35 Mon Sep 17 00:00:00 2001 From: miguelerm Date: Thu, 16 Feb 2012 14:36:28 -0800 Subject: [PATCH] #18419: Fixing !IE conditional comments Work Item: 18419 --HG-- branch : 1.x --- src/Orchard/UI/Resources/ResourceManager.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Orchard/UI/Resources/ResourceManager.cs b/src/Orchard/UI/Resources/ResourceManager.cs index 00407ce3e..c4a550dd1 100644 --- a/src/Orchard/UI/Resources/ResourceManager.cs +++ b/src/Orchard/UI/Resources/ResourceManager.cs @@ -24,6 +24,8 @@ namespace Orchard.UI.Resources { private List _footScripts; private IEnumerable _manifests; + private const string NotIE = "!IE"; + private static string ToAppRelativePath(string resourcePath) { if (!String.IsNullOrEmpty(resourcePath) && !Uri.IsWellFormedUriString(resourcePath, UriKind.Absolute)) { resourcePath = VirtualPathUtility.ToAppRelative(resourcePath); @@ -58,16 +60,30 @@ namespace Orchard.UI.Resources { public static void WriteResource(TextWriter writer, ResourceDefinition resource, string url, string condition, Dictionary attributes) { if (!string.IsNullOrEmpty(condition)) { - writer.WriteLine(""); + } } + var tagBuilder = GetTagBuilder(resource, url); + if (attributes != null) { // todo: try null value tagBuilder.MergeAttributes(attributes, true); } + writer.WriteLine(tagBuilder.ToString(resource.TagRenderMode)); + if (!string.IsNullOrEmpty(condition)) { - writer.WriteLine(""); + if (condition == NotIE) { + writer.WriteLine(""); + } + else { + writer.WriteLine(""); + } } }