Use RegexOption.SingleLine to handle transitions to sections which have embedded carriage returns in the section title.
This commit is contained in:
@@ -2888,7 +2888,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int lastIndex = 0;
|
||||
MatchCollection mc = Regex.Matches(line, @"<START\](.*?)#Link.*?\[END>");
|
||||
MatchCollection mc = Regex.Matches(line, @"<START\](.*?)#Link.*?\[END>", RegexOptions.Singleline);
|
||||
foreach (Match m in mc)
|
||||
{
|
||||
sb.Append(line.Substring(lastIndex, m.Index - lastIndex)); // Append text before the link
|
||||
@@ -2914,7 +2914,7 @@ namespace Volian.Controls.Library
|
||||
string lineAbove = RemoveLinkComments(Lines[row-1]);
|
||||
string lineBelow = RemoveLinkComments(Lines[row+1]);
|
||||
int rowOffset = GetFirstCharIndexFromLine(row);
|
||||
MatchCollection matchCollection = Regex.Matches(line, @"<START\](.*?)#Link.*?\[END>"); //, RegexOptions.Singleline);
|
||||
MatchCollection matchCollection = Regex.Matches(line, @"<START\](.*?)#Link.*?\[END>", RegexOptions.Singleline);// this last parameter was commented out in 7/24/09 but it appears to be valid
|
||||
if (matchCollection.Count == 0) matchCollection = Regex.Matches(line, @"<START\]");
|
||||
if (matchCollection.Count == 0) matchCollection = Regex.Matches(line, @"#Link.*?\[END>");
|
||||
Match match = matchCollection.Count > 0 ? matchCollection[0] : null;
|
||||
|
Reference in New Issue
Block a user