Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit 1a5a654

Browse files
authored
Merge pull request #73 from 7h3Rabbit/issue-72
fixing issue #72
2 parents 8571608 + 30f51c4 commit 1a5a654

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Services/HtmlDependencyService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ namespace StaticWebEpiserverPlugin.Services
99
{
1010
public class HtmlDependencyService : ITextResourceDependencyService
1111
{
12-
static readonly Regex REGEX_FIND_SOURCE_REFERENCE = new Regex("<(source).*(srcset)=[\"'](?<imageCandidates>[^\"']+)[\"'#]", RegexOptions.Compiled);
12+
static readonly Regex REGEX_FIND_SOURCE_REFERENCE = new Regex("<(source)[^>]+(srcset)=[\"'](?<imageCandidates>[^\"']+)[\"'#]", RegexOptions.Compiled);
1313
static readonly Regex REGEX_FIND_SOURCE_RESOUCE_REFERENCE = new Regex("(?<resource>[^, ]+)( [0-9.]+[w|x][,]{0,1})*", RegexOptions.Compiled);
14-
static readonly Regex REGEX_FIND_SCRIPT_OR_LINK_OR_IMG_OR_A_URL_REFERENCE = new Regex("<(script|link|img|a).*(href|src)=[\"'](?<resource>[^\"'#]+)", RegexOptions.Compiled);
14+
static readonly Regex REGEX_FIND_SCRIPT_OR_LINK_OR_IMG_OR_A_URL_REFERENCE = new Regex("<(script|link|img|a)[^>]+(href|src)=[\"'](?<resource>[^\"'#]+)[^>]+", RegexOptions.Compiled);
1515

1616
public string EnsureDependencies(string referencingUrl, string content, IStaticWebService staticWebService, SiteConfigurationElement configuration, bool? useTemporaryAttribute, bool ignoreHtmlDependencies, Dictionary<string, string> currentPageResourcePairs = null, ConcurrentDictionary<string, string> replaceResourcePairs = null, int callDepth = 0)
1717
{

0 commit comments

Comments
 (0)