fix: remove unnecessary mfm types
This commit is contained in:
parent
1a40218b9b
commit
1edf2a23ba
3 changed files with 3 additions and 7 deletions
|
@ -362,9 +362,7 @@ const expandOnNoteClick = defaultStore.state.expandOnNoteClick;
|
||||||
const purifyMFM = (src) => {
|
const purifyMFM = (src) => {
|
||||||
const nodes = mfm.parse(src);
|
const nodes = mfm.parse(src);
|
||||||
const filtered = mfm.extract(nodes, (node) => {
|
const filtered = mfm.extract(nodes, (node) => {
|
||||||
return ["text", "bold", "center", "small", "italic", "strike"].includes(
|
node.type === "text" || node.type === "quote";
|
||||||
node.type,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
return mfm.toString(filtered);
|
return mfm.toString(filtered);
|
||||||
};
|
};
|
||||||
|
|
|
@ -278,9 +278,7 @@ const expandOnNoteClick = defaultStore.state.expandOnNoteClick;
|
||||||
const purifyMFM = (src) => {
|
const purifyMFM = (src) => {
|
||||||
const nodes = mfm.parse(src);
|
const nodes = mfm.parse(src);
|
||||||
const filtered = mfm.extract(nodes, (node) => {
|
const filtered = mfm.extract(nodes, (node) => {
|
||||||
return ["text", "bold", "center", "small", "italic", "strike"].includes(
|
node.type === "text" || node.type === "quote";
|
||||||
node.type,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
return mfm.toString(filtered);
|
return mfm.toString(filtered);
|
||||||
};
|
};
|
||||||
|
|
|
@ -242,7 +242,7 @@ export function getNoteMenu(props: {
|
||||||
const res = await os.api("notes/translate", {
|
const res = await os.api("notes/translate", {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
targetLang:
|
targetLang:
|
||||||
localStorege.getItem("translateLang") ||
|
localStorage.getItem("translateLang") ||
|
||||||
localStorage.getItem("lang") ||
|
localStorage.getItem("lang") ||
|
||||||
navigator.language,
|
navigator.language,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue