From e13f24a577e8065f8033f0497a526957601b1c29 Mon Sep 17 00:00:00 2001 From: Oleksandr Hlushchenko Date: Sun, 20 Mar 2022 14:31:29 +0200 Subject: [PATCH] - Improves title parser by @uetchy #1272 --- FSNotes/Business/Note.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FSNotes/Business/Note.swift b/FSNotes/Business/Note.swift index 4f203db23..b71eee12f 100644 --- a/FSNotes/Business/Note.swift +++ b/FSNotes/Business/Note.swift @@ -1465,10 +1465,10 @@ public class Note: NSObject { tripleMinus += 1 } - let res = string.matchingStrings(regex: "(?:title: [\"\'”“])([^\\n]*)(?:[\"\'”“])") + let res = string.matchingStrings(regex: "^title: ([\"\'”“]?)([^\n]+)\\1$") if res.count > 0 { - title = res[0][1].trim() + title = res[0][2].trim() firstLineAsTitle = true }