Tentatively fixed #424: Phase3 special tags can now be used inside snippets.
This commit is contained in:
parent
826877c72e
commit
800fd8fb79
2 changed files with 20 additions and 10 deletions
|
@ -16,5 +16,5 @@ using System.Reflection;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.1.438")]
|
[assembly: AssemblyVersion("3.0.1.439")]
|
||||||
[assembly: AssemblyFileVersion("3.0.1.438")]
|
[assembly: AssemblyFileVersion("3.0.1.439")]
|
||||||
|
|
|
@ -809,6 +809,13 @@ namespace ScrewTurn.Wiki {
|
||||||
string internalSnippet = balanced.Substring(lastOpen, firstClosedAfterLastOpen - lastOpen + 1);
|
string internalSnippet = balanced.Substring(lastOpen, firstClosedAfterLastOpen - lastOpen + 1);
|
||||||
balanced = balanced.Remove(lastOpen, firstClosedAfterLastOpen - lastOpen + 1);
|
balanced = balanced.Remove(lastOpen, firstClosedAfterLastOpen - lastOpen + 1);
|
||||||
|
|
||||||
|
// This check allows to ignore special tags (especially Phase3)
|
||||||
|
if(!internalSnippet.ToLowerInvariant().StartsWith("{s:")) {
|
||||||
|
internalSnippet = internalSnippet.Replace("{", "$$$$$$$$OPEN$$$$$$$$").Replace("}", "$$$$$$$$CLOSE$$$$$$$$");
|
||||||
|
balanced = balanced.Insert(lastOpen, internalSnippet);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
string formattedInternalSnippet = FormatSnippet(internalSnippet, tocString);
|
string formattedInternalSnippet = FormatSnippet(internalSnippet, tocString);
|
||||||
string[] temp;
|
string[] temp;
|
||||||
formattedInternalSnippet = Format(formattedInternalSnippet, forIndexing, context, current, out temp, bareBones).Trim('\n');
|
formattedInternalSnippet = Format(formattedInternalSnippet, forIndexing, context, current, out temp, bareBones).Trim('\n');
|
||||||
|
@ -817,7 +824,7 @@ namespace ScrewTurn.Wiki {
|
||||||
balanced = balanced.Insert(lastOpen, formattedInternalSnippet);
|
balanced = balanced.Insert(lastOpen, formattedInternalSnippet);
|
||||||
} while(lastOpen != -1);
|
} while(lastOpen != -1);
|
||||||
|
|
||||||
sb.Insert(match.Index, balanced);
|
sb.Insert(match.Index, balanced.Replace("$$$$$$$$OPEN$$$$$$$$", "{").Replace("$$$$$$$$CLOSE$$$$$$$$", "}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ComputeNoWiki(sb.ToString(), ref noWikiBegin, ref noWikiEnd);
|
ComputeNoWiki(sb.ToString(), ref noWikiBegin, ref noWikiEnd);
|
||||||
|
@ -1316,13 +1323,16 @@ namespace ScrewTurn.Wiki {
|
||||||
string bigString = sb.ToString();
|
string bigString = sb.ToString();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
int dummy = bigString.IndexOf("{", tempIndex + 1);
|
||||||
|
if(dummy != -1) openCount++;
|
||||||
tempIndex = bigString.IndexOf("}", tempIndex + 1);
|
tempIndex = bigString.IndexOf("}", tempIndex + 1);
|
||||||
if(tempIndex != -1) {
|
if(tempIndex != -1) closeCount++;
|
||||||
closeCount++;
|
|
||||||
if(closeCount == openCount) {
|
tempIndex = Math.Max(dummy, tempIndex);
|
||||||
// Balanced
|
|
||||||
return bigString.Substring(index, tempIndex - index + 1);
|
if(closeCount == openCount) {
|
||||||
}
|
// Balanced
|
||||||
|
return bigString.Substring(index, tempIndex - index + 1);
|
||||||
}
|
}
|
||||||
} while(tempIndex != -1 && tempIndex < bigString.Length - 1);
|
} while(tempIndex != -1 && tempIndex < bigString.Length - 1);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue