Use RegexOption.SingleLine to handle transitions to sections which have embedded carriage returns in the section title.
This commit is contained in:
@@ -229,7 +229,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private bool InLinkedText(string text, int idx)
|
||||
{
|
||||
MatchCollection mc = Regex.Matches(text, @"<START\].*?\[END>");
|
||||
MatchCollection mc = Regex.Matches(text, @"<START\].*?\[END>", RegexOptions.Singleline);
|
||||
if (mc.Count == 0) return false;
|
||||
foreach (Match m in mc)
|
||||
if (m.Index < idx && m.Index + m.Length > idx) return true;
|
||||
@@ -1958,7 +1958,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if (_TextAndLink != null)
|
||||
{
|
||||
Match m = Regex.Match(_TextAndLink, @"<START\](\\[^v \\]+)*\\v0(\\[^v'?{}~ \\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{}~ \\]+)*\\v(\\[^v \\]+)* #Link:(.*?)\[END>");
|
||||
Match m = Regex.Match(_TextAndLink, @"<START\](\\[^v \\]+)*\\v0(\\[^v'?{}~ \\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{}~ \\]+)*\\v(\\[^v \\]+)* #Link:(.*?)\[END>", RegexOptions.Singleline);
|
||||
if(m.Groups[3].Value == " ")
|
||||
return m.Groups[4].Value;
|
||||
return m.Groups[3].Value + m.Groups[4].Value;
|
||||
@@ -1969,7 +1969,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if (_TextAndLink != null)
|
||||
{
|
||||
Match m = Regex.Match(_TextAndLink, @"<START\](\\[^v \\]+)*\\v0(\\[^v'?{}~ \\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{}~ \\]+)*\\v(\\[^v \\]+)* #Link:(.*?)\[END>");
|
||||
Match m = Regex.Match(_TextAndLink, @"<START\](\\[^v \\]+)*\\v0(\\[^v'?{}~ \\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{}~ \\]+)*\\v(\\[^v \\]+)* #Link:(.*?)\[END>", RegexOptions.Singleline);
|
||||
int myIndex = m.Groups[4].Index;
|
||||
int myLength = m.Groups[4].Length;
|
||||
if (m.Groups[3].Value != " ")
|
||||
|
Reference in New Issue
Block a user