import { Paragraph, TextRun, HeadingLevel, ParagraphChild } from "docx" // 本模块主要用于复杂文本标签结构,从中提取#text节点,Element依然由handleElement处理 export const handleNodes = (nodes: NodeListOf): ParagraphChild[] => { const paragraphChildList: ParagraphChild[] = [] nodes.forEach((n) => { if (n.nodeType === 3) { // TEXT节点 } else if (n.nodeType === 1) { // ELEMENT节点 } }) return new Paragraph({ children: [new TextRun()], spacing: { after: 200 }, }) }