5
5
LSPluginBaseInfo ,
6
6
SettingSchemaDesc ,
7
7
} from '@logseq/libs/dist/LSPlugin'
8
- import { getDateForPage } from 'logseq-dateutils' ;
8
+ import { getDateForPage } from 'logseq-dateutils'
9
9
import icon from './icon.png'
10
10
import { Article , loadArticles } from './util'
11
11
@@ -38,8 +38,9 @@ const settings: SettingSchemaDesc[] = [
38
38
const siteNameFromUrl = ( originalArticleUrl : string ) : string => {
39
39
try {
40
40
return new URL ( originalArticleUrl ) . hostname . replace ( / ^ w w w \. / , '' )
41
- } catch { }
42
- return ''
41
+ } catch {
42
+ return ''
43
+ }
43
44
}
44
45
45
46
const delay = ( t = 100 ) => new Promise ( ( r ) => setTimeout ( r , t ) )
@@ -69,8 +70,8 @@ const fetchOmnivore = async (
69
70
70
71
loading = true
71
72
let targetBlock : BlockEntity | null = null
72
- const userConfigs = await logseq . App . getUserConfigs ( ) ;
73
- const preferredDateFormat : string = userConfigs . preferredDateFormat ;
73
+ const userConfigs = await logseq . App . getUserConfigs ( )
74
+ const preferredDateFormat : string = userConfigs . preferredDateFormat
74
75
75
76
try {
76
77
! inBackground && ( await logseq . UI . showMsg ( '🚀 Fetching articles ...' ) )
@@ -117,8 +118,9 @@ const fetchOmnivore = async (
117
118
let content = `[${ article . title } ](https://omnivore.app/me/${ article . slug } )`
118
119
content += '\ncollapsed:: true'
119
120
120
- const displaySiteName = article . siteName || siteNameFromUrl ( article . originalArticleUrl )
121
- console . log ( "display site name" , displaySiteName )
121
+ const displaySiteName =
122
+ article . siteName || siteNameFromUrl ( article . originalArticleUrl )
123
+ console . log ( 'display site name' , displaySiteName )
122
124
if ( displaySiteName ) {
123
125
content += `\nsite:: [${ displaySiteName } ](${ article . originalArticleUrl } )`
124
126
}
@@ -133,7 +135,10 @@ const fetchOmnivore = async (
133
135
. join ( ) } `
134
136
}
135
137
136
- content += `\ndate_saved:: ${ getDateForPage ( new Date ( article . savedAt ) , preferredDateFormat ) } `
138
+ content += `\ndate_saved:: ${ getDateForPage (
139
+ new Date ( article . savedAt ) ,
140
+ preferredDateFormat
141
+ ) } `
137
142
138
143
// remove existing block for the same article
139
144
const existingBlocks = await logseq . DB . q < BlockEntity > (
0 commit comments