Merge pull request #6194 from jtkech/patch-6

[Fixes #6193] TokenFilters Cohabitation
This commit is contained in:
Sébastien Ros
2015-12-17 12:18:40 -08:00

View File

@@ -53,7 +53,9 @@ namespace Orchard.Tokens.Implementation {
var replacements = Evaluate(options.Predicate == null ? tokens : tokens.Where(options.Predicate), data);
return replacements.Aggregate(tokenset.Item1,
(current, replacement) => current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}", (options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value)));
(current, replacement) => replacement.Value == null ?
current : current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}",
(options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value)));
}
private static Tuple<string, IEnumerable<string>> Parse(string text, bool hashMode) {
@@ -111,4 +113,4 @@ namespace Orchard.Tokens.Implementation {
}
}
}
}