File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,17 @@ func GetUnlinked(db *gorm.DB, unlinked *[]string) {
207
207
GetAllNotes (db , & allNotes )
208
208
reference := make (map [string ][]string )
209
209
r , _ := regexp .Compile ("\\ (bear:\\ /\\ /x-callback-url\\ /open-note?(.*)\\ )" )
210
+ idr , _ := regexp .Compile ("bear:\\ /\\ /x-callback-url\\ /open-note\\ ?id=([^&)]*)?" )
210
211
for _ , note := range allNotes {
211
212
reference [note .Identifier ] = make ([]string , 0 )
212
213
matches := r .FindAllString (note .Text , - 1 )
213
214
for _ , mark := range matches {
214
- identifier := mark [36 : len (mark )- 1 ]
215
- reference [identifier ] = append (reference [identifier ], note .Identifier )
215
+
216
+ idMatches := idr .FindStringSubmatch (mark )
217
+ if len (idMatches ) >= 2 {
218
+ reference [idMatches [1 ]] = append (reference [idMatches [1 ]], note .Identifier )
219
+ }
220
+
216
221
}
217
222
}
218
223
// filter out entries with no backlinks
You can’t perform that action at this time.
0 commit comments