mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 08:38:41 +08:00
fix douban note import
This commit is contained in:
parent
a1d818af2f
commit
bf963ec126
@ -4,6 +4,7 @@ import DoubanNoteSubject from 'douban/model/DoubanNoteSubject';
|
|||||||
import DoubanPlugin from "main";
|
import DoubanPlugin from "main";
|
||||||
import { DoubanPluginSettings } from "douban/Douban";
|
import { DoubanPluginSettings } from "douban/Douban";
|
||||||
import DoubanSubject from "douban/model/DoubanSubject";
|
import DoubanSubject from "douban/model/DoubanSubject";
|
||||||
|
import html2markdown from '@notable/html2markdown';
|
||||||
import { moment } from "obsidian";
|
import { moment } from "obsidian";
|
||||||
|
|
||||||
export default class DoubanNoteLoadHandler extends DoubanAbstractLoadHandler<DoubanNoteSubject> {
|
export default class DoubanNoteLoadHandler extends DoubanAbstractLoadHandler<DoubanNoteSubject> {
|
||||||
@ -52,7 +53,7 @@ export default class DoubanNoteLoadHandler extends DoubanAbstractLoadHandler<Dou
|
|||||||
const result:DoubanNoteSubject = {
|
const result:DoubanNoteSubject = {
|
||||||
image: image,
|
image: image,
|
||||||
timePublished: timePublished ? new Date(timePublished) : null,
|
timePublished: timePublished ? new Date(timePublished) : null,
|
||||||
content: content ? content.toString().replaceAll(`<div class="note">`, "").replaceAll(`</div>`, "").replaceAll(`<br>`, " \n"): "",
|
content: content ? html2markdown(content.toString()): "",
|
||||||
id: id ? id[0] : "",
|
id: id ? id[0] : "",
|
||||||
type: "Article",
|
type: "Article",
|
||||||
title: title,
|
title: title,
|
||||||
|
|||||||
13
package-lock.json
generated
13
package-lock.json
generated
@ -67,6 +67,14 @@
|
|||||||
"fastq": "^1.6.0"
|
"fastq": "^1.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@notable/html2markdown": {
|
||||||
|
"version": "1.1.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@notable/html2markdown/-/html2markdown-1.1.3.tgz",
|
||||||
|
"integrity": "sha512-+WxHtqtZHqYRx0Zi7dhe+pGhlmds/mi+ZaNO26OJ991+LYGjqskVFa9VRsWfux2keaCkIMXitGgeViSW3wHLag==",
|
||||||
|
"requires": {
|
||||||
|
"mime2ext": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/codemirror": {
|
"@types/codemirror": {
|
||||||
"version": "0.0.108",
|
"version": "0.0.108",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/codemirror/-/codemirror-0.0.108.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/codemirror/-/codemirror-0.0.108.tgz",
|
||||||
@ -723,6 +731,11 @@
|
|||||||
"mime-db": "1.52.0"
|
"mime-db": "1.52.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mime2ext": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/mime2ext/-/mime2ext-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-GW9keW4FtnqfEn4PltsEiSlfQj3rNAU+nGsvPk8+4kQJpo0tQ7/dCojFYgkPtOD2xk9ePrRqVFUAtPpjzY1Cgw=="
|
||||||
|
},
|
||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.29.2",
|
"version": "2.29.2",
|
||||||
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.29.2.tgz",
|
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.29.2.tgz",
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
"typescript": "4.7.2"
|
"typescript": "4.7.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@notable/html2markdown": "^1.1.3",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"cheerio": "^1.0.0-rc.11",
|
"cheerio": "^1.0.0-rc.11",
|
||||||
"douban-search-crack": "^1.0.6",
|
"douban-search-crack": "^1.0.6",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user