Preparing scheduled task for Obsidian sync + Repare OFM html not rendered

This commit is contained in:
Peaceultime 2024-08-21 00:38:21 +02:00
parent 7e318d4a12
commit a9a98b9618
5 changed files with 901 additions and 861 deletions

View File

@ -6,6 +6,7 @@ import RemarkRehype from 'remark-rehype';
import RemarkOfm from 'remark-ofm';
import RemarkBreaks from 'remark-breaks'
import RemarkGfm from 'remark-gfm';
import RehypeRaw from 'rehype-raw';
export default function useMarkdown(): (md: string) => Root
{
@ -14,7 +15,9 @@ export default function useMarkdown(): (md: string) => Root
const parse = (markdown: string) => {
if (!processor)
{
processor = unified().use([RemarkParse, RemarkBreaks, RemarkGfm, RemarkOfm, RemarkRehype]);
processor = unified().use([RemarkParse, RemarkGfm, RemarkOfm, RemarkBreaks]);
processor.use(RemarkRehype, { allowDangerousHtml: true });
processor.use(RehypeRaw);
}
const processed = processor.runSync(processor.parse(markdown)) as Root;

BIN
db.sqlite

Binary file not shown.

View File

@ -19,8 +19,16 @@ export default defineNuxtConfig({
pathPrefix: false,
},
],
nitro: {
experimental: {
tasks: true,
},
scheduledTasks: {
'* * * * *': ['sync']
}
},
security: {
rateLimiter: false
},
compatibilityDate: '2024-07-25'
compatibilityDate: '2024-07-25',
})

File diff suppressed because one or more lines are too long

888
server/tasks/sync.ts Normal file

File diff suppressed because one or more lines are too long