Skip to content

Commit b3536df

Browse files
authored
Merge pull request #31 from windows-toolkit/bugfix/issue-30
Fixed regex parsing with sharp symbols
2 parents aaf9e98 + 1fac738 commit b3536df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/MvvmSampleUwp/MvvmSampleUwp/Helpers/MarkdownHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public static class MarkdownHelper
2121
public static IReadOnlyDictionary<string, string> GetParagraphs(string text)
2222
{
2323
return
24-
Regex.Matches(text, @"(#+ ([^\n]+)[^#]+)", RegexOptions.Singleline)
24+
Regex.Matches(text, @"(?<=\W)#+ ([^\n]+).+?(?=\W#|$)", RegexOptions.Singleline)
2525
.ToDictionary(
26-
m => m.Groups[2].Value.Trim().Replace("&lt;", "<"),
27-
m => m.Groups[1].Value.Trim().Replace("&lt;", "<").Replace("[!WARNING]", "**WARNING:**"));
26+
m => m.Groups[1].Value.Trim().Replace("&lt;", "<"),
27+
m => m.Groups[0].Value.Trim().Replace("&lt;", "<").Replace("[!WARNING]", "**WARNING:**").Replace("[!NOTE]", "**NOTE:**"));
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)