|
|
@@ -103,25 +103,17 @@ namespace Util
|
|
|
{
|
|
|
Dictionary<string, string> replaceDict = new Dictionary<string, string>();
|
|
|
int index = 0;
|
|
|
- MatchCollection subLoops = Regex.Matches(itemString, "<<ym-loop:.*?>>[\\s\\S]*?<</ym-loop:.*?>>");
|
|
|
+ MatchCollection subLoops = Regex.Matches(itemString, "<<.*?>>");
|
|
|
foreach (Match subLoop in subLoops)
|
|
|
{
|
|
|
index += 1;
|
|
|
- itemString = Regex.Replace(itemString, subLoop.Value, "${loop" + index + "}$");
|
|
|
- replaceDict.Add("loop" + index, subLoop.Value);
|
|
|
- }
|
|
|
- index = 0;
|
|
|
- MatchCollection subItems = Regex.Matches(itemString, "<<ym-item:.*?>>[\\s\\S]*?<</ym-item:.*?>>");
|
|
|
- foreach (Match subItem in subItems)
|
|
|
- {
|
|
|
- index += 1;
|
|
|
- itemString = Regex.Replace(itemString, subItem.Value, "${item" + index + "}$");
|
|
|
- replaceDict.Add("item" + index, subItem.Value);
|
|
|
+ itemString = itemString.Replace(subLoop.Value, "${tag" + index + "}$");
|
|
|
+ replaceDict.Add("tag" + index, subLoop.Value);
|
|
|
}
|
|
|
itemString = itemString.Replace("<<" + itemKey + ">>", itemObj.ToString());
|
|
|
- foreach (var replace in replaceDict)
|
|
|
+ foreach (var replaceKey in replaceDict.Keys)
|
|
|
{
|
|
|
- itemString = itemString.Replace("${" + replace.Key + "}$", replace.Value);
|
|
|
+ itemString = itemString.Replace("${" + replaceKey + "}$", replaceDict[replaceKey]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -188,25 +180,17 @@ namespace Util
|
|
|
{
|
|
|
Dictionary<string, string> replaceDict = new Dictionary<string, string>();
|
|
|
int index = 0;
|
|
|
- MatchCollection subLoops = Regex.Matches(itemString, "<<ym-loop:.*?>>[\\s\\S]*?<</ym-loop:.*?>>");
|
|
|
+ MatchCollection subLoops = Regex.Matches(itemString, "<<.*?>>");
|
|
|
foreach (Match subLoop in subLoops)
|
|
|
{
|
|
|
index += 1;
|
|
|
- itemString = Regex.Replace(itemString, subLoop.Value, "${loop" + index + "}$");
|
|
|
- replaceDict.Add("loop" + index, subLoop.Value);
|
|
|
- }
|
|
|
- index = 0;
|
|
|
- MatchCollection subItems = Regex.Matches(itemString, "<<ym-item:.*?>>[\\s\\S]*?<</ym-item:.*?>>");
|
|
|
- foreach (Match subItem in subItems)
|
|
|
- {
|
|
|
- index += 1;
|
|
|
- itemString = Regex.Replace(itemString, subItem.Value, "${item" + index + "}$");
|
|
|
- replaceDict.Add("item" + index, subItem.Value);
|
|
|
+ itemString = Regex.Replace(itemString, subLoop.Value, "${tag" + index + "}$");
|
|
|
+ replaceDict.Add("tag" + index, subLoop.Value);
|
|
|
}
|
|
|
itemString = itemString.Replace("<<" + itemKey + ">>", itemObj.ToString());
|
|
|
- foreach (var replace in replaceDict)
|
|
|
+ foreach (var replaceKey in replaceDict.Keys)
|
|
|
{
|
|
|
- itemString = itemString.Replace("${" + replace.Key + "}$", replace.Value);
|
|
|
+ itemString = itemString.Replace("${" + replaceKey + "}$", replaceDict[replaceKey]);
|
|
|
}
|
|
|
}
|
|
|
}
|