Skip to content

Commit

Permalink
fix: 重命名函数以提高可读性,更新列表项反序列化逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jan 30, 2025
1 parent 567fd5c commit f14da68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MarkdownEditor/editor/utils/docx/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const makeDeserializer = (jsx: any) => {

function deserializeListItem(el: any, imageTags: any) {
const level = el.getAttribute('style');
const content = getTextfromList(el)
const content = extractTextFromNodes(el)
.map((c) => {
return deserializeElement(c as any, imageTags);
})
Expand Down Expand Up @@ -211,7 +211,7 @@ function isList(el: {
// receives a list item and returns the text inside it
// sometimes the text will be inside a text tag or inside a span tag.
// when it is inside a text tag, the span is irrelevant, but it contains empty text inside
function getTextfromList(el: {
function extractTextFromNodes(el: {
childNodes: Iterable<unknown> | ArrayLike<unknown>;
}) {
const children = Array.from(el.childNodes);
Expand Down

1 comment on commit f14da68

@vercel
Copy link

@vercel vercel bot commented on f14da68 Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.