File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ const snackbar = useSnackbar();
8686const showDialog = ref (false );
8787const md = new MarkdownIt ();
8888// eslint-disable-next-line @typescript-eslint/no-unsafe-call
89- const { turndown } = new TurndownService () as {
90- turndown: (input : string ) => string ;
91- };
89+ const turndownService = new TurndownService () as { turndown: (input : string ) => string };
9290const tinyMceKey = computed (() => envVariables .tinyMceKey );
9391const isTinyMceKeyEmpty = computed (() => tinyMceKey .value === " " );
9492const announcement = computed (() => announcementStore .announcement );
@@ -127,7 +125,7 @@ const onSubmit = async () => {
127125 }
128126
129127 try {
130- const contentInMarkdown = turndown (contentInHtml .value );
128+ const contentInMarkdown = turndownService . turndown (contentInHtml .value );
131129 await announcementStore .updateAnnouncement (announcement .value .uuid , {
132130 title: title .value ?? " " ,
133131 content: contentInMarkdown ,
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ const tinyMceKeyIsEmpty = computed(() => tinyMceKey.value === "");
8888const announcement = ref (" " );
8989const announcementError = ref (false );
9090// eslint-disable-next-line @typescript-eslint/no-unsafe-call
91- const { turndown } = new TurndownService () as { turndown: (input : string ) => string };
91+ const turndownService = new TurndownService () as { turndown: (input : string ) => string };
9292
9393watch (announcement , (val ) => {
9494 if (val ) announcementError .value = false ;
@@ -107,7 +107,7 @@ const postAnnouncement = async () => {
107107 }
108108
109109 try {
110- const contentInHtml = turndown (announcement .value );
110+ const contentInHtml = turndownService . turndown (announcement .value );
111111 await announcementStore .createAnnouncement ({
112112 title: title .value ,
113113 content: contentInHtml ,
You can’t perform that action at this time.
0 commit comments