From b16a14cab1a524cf3138eb05b6db70fbc95a01a5 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 6 Oct 2016 11:17:13 +0800 Subject: [PATCH] Relax front-matter rule to match CR and CRLF Fix #669 --- MacDown/Code/Extension/NSString+Lookup.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MacDown/Code/Extension/NSString+Lookup.m b/MacDown/Code/Extension/NSString+Lookup.m index c6010eb2..fd972a29 100644 --- a/MacDown/Code/Extension/NSString+Lookup.m +++ b/MacDown/Code/Extension/NSString+Lookup.m @@ -54,7 +54,8 @@ - (NSArray *)matchesForPattern:(NSString *)p - (id)frontMatter:(NSUInteger *)contentOffset { - static NSString *pattern = @"^-{3}\n(.*?\n)((?:-{3})|(?:\\.{3}))"; + static NSString *pattern = + @"^-{3}[\r\n]+(.*?[\r\n]+)((?:-{3})|(?:\\.{3}))"; NSRegularExpressionOptions op = NSRegularExpressionDotMatchesLineSeparators; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern