|
|
@@ -101,7 +101,28 @@ namespace Util
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ Dictionary<string, string> replaceDict = new Dictionary<string, string>();
|
|
|
+ int index = 0;
|
|
|
+ MatchCollection subLoops = Regex.Matches(itemString, "<<ym-loop:.*?>>[\\s\\S]*?<</ym-loop:.*?>>");
|
|
|
+ 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("<<" + itemKey + ">>", itemObj.ToString());
|
|
|
+ foreach (var replace in replaceDict)
|
|
|
+ {
|
|
|
+ itemString = itemString.Replace("${" + replace.Key + "}$", replace.Value);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -165,7 +186,28 @@ namespace Util
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ Dictionary<string, string> replaceDict = new Dictionary<string, string>();
|
|
|
+ int index = 0;
|
|
|
+ MatchCollection subLoops = Regex.Matches(itemString, "<<ym-loop:.*?>>[\\s\\S]*?<</ym-loop:.*?>>");
|
|
|
+ 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("<<" + itemKey + ">>", itemObj.ToString());
|
|
|
+ foreach (var replace in replaceDict)
|
|
|
+ {
|
|
|
+ itemString = itemString.Replace("${" + replace.Key + "}$", replace.Value);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|