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 nodes = mfm.parse(src);
|
||||
const filtered = mfm.extract(nodes, (node) => {
|
||||
return ["text", "bold", "center", "small", "italic", "strike"].includes(
|
||||
node.type,
|
||||
);
|
||||
node.type === "text" || node.type === "quote";
|
||||
});
|
||||
return mfm.toString(filtered);
|
||||
};
|
||||
|
|
|
@ -278,9 +278,7 @@ const expandOnNoteClick = defaultStore.state.expandOnNoteClick;
|
|||
const purifyMFM = (src) => {
|
||||
const nodes = mfm.parse(src);
|
||||
const filtered = mfm.extract(nodes, (node) => {
|
||||
return ["text", "bold", "center", "small", "italic", "strike"].includes(
|
||||
node.type,
|
||||
);
|
||||
node.type === "text" || node.type === "quote";
|
||||
});
|
||||
return mfm.toString(filtered);
|
||||
};
|
||||
|
|
|
@ -242,7 +242,7 @@ export function getNoteMenu(props: {
|
|||
const res = await os.api("notes/translate", {
|
||||
noteId: appearNote.id,
|
||||
targetLang:
|
||||
localStorege.getItem("translateLang") ||
|
||||
localStorage.getItem("translateLang") ||
|
||||
localStorage.getItem("lang") ||
|
||||
navigator.language,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue