Skip to content

Commit

Permalink
Merge pull request #142 from craigs100/Modify_HTML_Output
Browse files Browse the repository at this point in the history
Modified HTML Output
  • Loading branch information
Shazwazza committed Apr 11, 2022
2 parents 391ed15 + cb935ba commit 2e1e203
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Smidge/SmidgeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task<HtmlString> JsHereAsync(string bundleName, bool debug = false)

foreach (var url in urls)
{
result.AppendFormat("<script src='{0}' type='text/javascript'></script>", url);
result.AppendFormat("<script src=\"{0}\"></script>", url);
}
return new HtmlString(result.ToString());
}
Expand All @@ -90,7 +90,7 @@ public async Task<HtmlString> CssHereAsync(string bundleName, bool debug = false

foreach (var url in urls)
{
result.AppendFormat("<link href='{0}' rel='stylesheet' type='text/css'/>", url);
result.AppendFormat("<link href=\"{0}\" rel=\"stylesheet\">", url);
}
return new HtmlString(result.ToString());
}
Expand All @@ -100,7 +100,7 @@ public async Task<HtmlString> CssHereAsync(string bundleName, bool debug = false
/// </summary>
/// <returns></returns>
/// <remarks>
/// TODO: Once the tags are rendered the collection on the context is cleared. Therefore if this method is called multiple times it will
/// TODO: Once the tags are rendered the collection on the context is cleared. Therefore if this method is called multiple times it will
/// render anything that has been registered as 'pending' but has not been rendered.
/// </remarks>
public async Task<HtmlString> JsHereAsync(PreProcessPipeline pipeline = null, bool debug = false)
Expand All @@ -109,7 +109,7 @@ public async Task<HtmlString> JsHereAsync(PreProcessPipeline pipeline = null, bo
var urls = await GenerateJsUrlsAsync(pipeline, debug);
foreach (var url in urls)
{
result.AppendFormat("<script src='{0}' type='text/javascript'></script>", url);
result.AppendFormat("<script src=\"{0}\"></script>", url);
}
return new HtmlString(result.ToString());
}
Expand All @@ -119,7 +119,7 @@ public async Task<HtmlString> JsHereAsync(PreProcessPipeline pipeline = null, bo
/// </summary>
/// <returns></returns>
/// <remarks>
/// TODO: Once the tags are rendered the collection on the context is cleared. Therefore if this method is called multiple times it will
/// TODO: Once the tags are rendered the collection on the context is cleared. Therefore if this method is called multiple times it will
/// render anything that has been registered as 'pending' but has not been rendered.
/// </remarks>
public async Task<HtmlString> CssHereAsync(PreProcessPipeline pipeline = null, bool debug = false)
Expand All @@ -128,7 +128,7 @@ public async Task<HtmlString> CssHereAsync(PreProcessPipeline pipeline = null, b
var urls = await GenerateCssUrlsAsync(pipeline, debug);
foreach (var url in urls)
{
result.AppendFormat("<link href='{0}' rel='stylesheet' type='text/css'/>", url);
result.AppendFormat("<link href=\"{0}\" rel=\"stylesheet\">", url);
}
return new HtmlString(result.ToString());
}
Expand Down Expand Up @@ -192,8 +192,8 @@ private IEnumerable<string> GenerateBundleUrlsAsync(string bundleName, string fi

//if not processing as composite files, then just use their native file paths
if (!bundleOptions.ProcessAsCompositeFile)
{
var files = _fileSetGenerator.GetOrderedFileSet(bundle,
{
var files = _fileSetGenerator.GetOrderedFileSet(bundle,
_processorFactory.CreateDefault(
//the file type in the bundle will always be the same
bundle.Files[0].DependencyType));
Expand Down Expand Up @@ -225,7 +225,7 @@ private IEnumerable<string> GenerateBundleUrlsAsync(string bundleName, string fi
bool debug = false)
{
var result = new List<string>();

var orderedFiles = _fileSetGenerator.GetOrderedFileSet(files, pipeline ?? _processorFactory.CreateDefault(fileType));

var cacheBuster = _cacheBusterResolver.GetCacheBuster(_bundleManager.GetDefaultBundleOptions(debug).GetCacheBusterType());
Expand All @@ -237,7 +237,7 @@ private IEnumerable<string> GenerateBundleUrlsAsync(string bundleName, string fi
}

var compression = _requestHelper.GetClientCompression(_httpContextAccessor.HttpContext.Request.Headers);

//Get the file collection used to create the composite URLs and the external requests
var fileBatches = _fileBatcher.GetCompositeFileCollectionForUrlGeneration(orderedFiles);

Expand All @@ -254,7 +254,7 @@ private IEnumerable<string> GenerateBundleUrlsAsync(string bundleName, string fi
//Get the URLs for the batch, this could be more than one resulting URL depending on how many
// files are in the batch and the max url length
var compositeUrls = _urlManager.GetUrls(
batch.Select(x => x.Hashed),
batch.Select(x => x.Hashed),
fileType == WebFileType.Css ? ".css" : ".js",
cacheBusterValue);

Expand Down Expand Up @@ -349,4 +349,4 @@ public ISmidgeRequire CreateCssBundle(string bundleName)
return new SmidgeRequire(bundleName, _bundleManager, WebFileType.Css, _requestHelper);
}
}
}
}

0 comments on commit 2e1e203

Please sign in to comment.