docxTitle.ts 241 B

1234567891011121314
  1. const handleTitle = (el: Element): string | undefined => {
  2. const tag = el.tagName.toLowerCase()
  3. // 标题处理
  4. if (tag === "h1") {
  5. return el.textContent?.trim()
  6. }
  7. }
  8. export default {
  9. handleTitle,
  10. config: {} // 无配置
  11. }