fix: remove unnecessary mfm types

This commit is contained in:
naskya 2023-08-01 21:40:23 +09:00
parent 1a40218b9b
commit 1edf2a23ba
Signed by: naskya
GPG key ID: 164DFF24E2D40139
3 changed files with 3 additions and 7 deletions

View file

@ -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);
};

View file

@ -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);
};

View file

@ -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,
});