Skip to content

Commit

Permalink
- Improves title parser by @uetchy #1272
Browse files Browse the repository at this point in the history
  • Loading branch information
glushchenko committed Mar 20, 2022
1 parent eb52093 commit e13f24a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FSNotes/Business/Note.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e13f24a

Please sign in to comment.