Sfoglia il codice sorgente

Merge branch 'iteration-20241107-homework' into jenkins

lex-xin 1 settimana fa
parent
commit
e87089f9c0

+ 20 - 0
src/styles/index.less

@@ -471,4 +471,24 @@ body>.n-drawer-container-relative {
 
 .only-child-select {
   all: revert;
+}
+.html-to-dom {
+  div, span, applet, object, iframe,
+  h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+  a, abbr, acronym, address, big, cite, code,
+  del, dfn, em, img, ins, kbd, q, s, samp,
+  small, strike, strong, sub, sup, tt, var,
+  b, u, i, center,
+  dl, dt, dd, ol, ul, li,
+  fieldset, form, label, legend,
+  table, caption, tbody, tfoot, thead, tr, th, td,
+  article, aside, canvas, details, embed, 
+  figure, figcaption, footer, header, hgroup, 
+  menu, nav, output, ruby, section, summary,
+  time, mark, audio, video, hr {
+    all: revert;
+  }
+  hr {
+    border-top: 1px solid #D2D2D2;
+  }
 }

+ 4 - 1
src/views/content-information/content-instrument/detail.tsx

@@ -141,9 +141,12 @@ export default defineComponent({
       const doc = parser.parseFromString(res.data.intros, 'text/html');
 
       // 提取并分割 HTML 文档中的内容
+      const result = document.createElement("div")
+        result.classList.add("html-to-dom")
+        result.appendChild(speak.processNode(doc.body))
       document
         .querySelector('#musicContent')
-        ?.appendChild(speak.processNode(doc.body));
+        ?.appendChild(result);
 
       data.details = res.data;
       data.loading = false;

+ 4 - 1
src/views/content-information/content-knowledge/index.tsx

@@ -86,9 +86,12 @@ export default defineComponent({
         });
 
         // 提取并分割 HTML 文档中的内容
+        const result = document.createElement("div")
+        result.classList.add("html-to-dom")
+        result.appendChild(speak.processNode(doc.body))
         document
           .querySelector('#musicContent')
-          ?.appendChild(speak.processNode(doc.body));
+          ?.appendChild(result);
         state.details = data;
       } catch {
         //

+ 4 - 1
src/views/content-information/content-music/detail.tsx

@@ -128,9 +128,12 @@ export default defineComponent({
       const doc = parser.parseFromString(res.data.intros, 'text/html');
 
       // 提取并分割 HTML 文档中的内容
+      const result = document.createElement("div")
+        result.classList.add("html-to-dom")
+        result.appendChild(speak.processNode(doc.body))
       document
         .querySelector('#musicContent')
-        ?.appendChild(speak.processNode(doc.body));
+        ?.appendChild(result);
       data.details = res.data;
       data.loading = false;
     };

+ 4 - 1
src/views/prepare-lessons/model/source-instrument/detail.tsx

@@ -159,9 +159,12 @@ export default defineComponent({
       const doc = parser.parseFromString(res.data.intros, 'text/html');
 
       // 提取并分割 HTML 文档中的内容
+      const result = document.createElement("div")
+        result.classList.add("html-to-dom")
+        result.appendChild(speak.processNode(doc.body))
       document
         .querySelector('#' + speakMusicContent)
-        ?.appendChild(speak.processNode(doc.body));
+        ?.appendChild(result);
 
       data.details = res.data;
       data.loading = false;

+ 4 - 1
src/views/prepare-lessons/model/source-knowledge/detail.tsx

@@ -88,7 +88,10 @@ export default defineComponent({
           // 提取并分割 HTML 文档中的内容
 
           const node: any = speak.processNode(doc.body);
-          document.querySelector('#' + speakMusicContent)?.appendChild(node);
+          const result = document.createElement("div")
+          result.classList.add("html-to-dom")
+          result.appendChild(node)
+          document.querySelector('#' + speakMusicContent)?.appendChild(result);
         });
       } catch {
         //

+ 4 - 1
src/views/prepare-lessons/model/source-knowledge/index.tsx

@@ -97,9 +97,12 @@ export default defineComponent({
           });
 
           // 提取并分割 HTML 文档中的内容
+          const result = document.createElement("div")
+          result.classList.add("html-to-dom")
+          result.appendChild(speak.processNode(doc.body))
           document
             .querySelector('#' + speakMusicContent)
-            ?.appendChild(speak.processNode(doc.body));
+            ?.appendChild(result);
         });
       } catch {
         //

+ 4 - 1
src/views/prepare-lessons/model/source-music/detail.tsx

@@ -155,9 +155,12 @@ export default defineComponent({
         const doc = parser.parseFromString(res.data.intros, 'text/html');
 
         // 提取并分割 HTML 文档中的内容
+        const result = document.createElement("div")
+        result.classList.add("html-to-dom")
+        result.appendChild(speak.processNode(doc.body))
         document
           .querySelector('#' + speakMusicContent)
-          ?.appendChild(speak.processNode(doc.body));
+          ?.appendChild(result);
 
         data.details = res.data;
       } catch {