mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
fix(parser): 完善数据解析
This commit is contained in:
@@ -62,9 +62,10 @@ import TLoading from "../components/t-loading.vue";
|
||||
import { fs, http } from "@tauri-apps/api";
|
||||
// store
|
||||
import useAppStore from "../store/modules/app";
|
||||
// plugin
|
||||
import Mys_Oper from "../plugins/Mys";
|
||||
// utils
|
||||
import { createTGWindow } from "../utils/TGWindow";
|
||||
import { StructuredPostParser } from "../plugins/Mys/utils/parser";
|
||||
// interface
|
||||
import {
|
||||
GachaResponse,
|
||||
@@ -180,7 +181,7 @@ async function toPost(post_id: string) {
|
||||
return res.data.post.post;
|
||||
});
|
||||
// 结构化渲染
|
||||
const parseDoc = StructuredPostParser(post.structured_content);
|
||||
const parseDoc = Mys_Oper.PostParser(post.structured_content);
|
||||
// 将解析后的 doc 保存到 文件
|
||||
await fs.writeTextFile(
|
||||
`${appStore.dataPath.temp}\\${post_id}_home.html`,
|
||||
|
||||
@@ -132,9 +132,10 @@ import useAppStore from "../store/modules/app";
|
||||
// tools
|
||||
// @ts-ignore
|
||||
import "../tools/svg-inject.js";
|
||||
// plugin
|
||||
import Mys_Oper from "../plugins/Mys";
|
||||
// utils
|
||||
import { createTGWindow } from "../utils/TGWindow";
|
||||
import { StructuredPostParser } from "../plugins/Mys/utils/parser";
|
||||
// interface
|
||||
import {
|
||||
Post,
|
||||
@@ -215,7 +216,7 @@ async function toPost(post_id: string) {
|
||||
// 获取渲染模式
|
||||
if (renderMode.value) {
|
||||
// 结构化渲染
|
||||
parseDoc = StructuredPostParser(post.structured_content);
|
||||
parseDoc = Mys_Oper.PostParser(post.structured_content);
|
||||
} else {
|
||||
// 原始渲染
|
||||
parseDoc = new DOMParser().parseFromString(post.content, "text/html");
|
||||
|
||||
Reference in New Issue
Block a user