-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3974 from udecode/fix/html
- Loading branch information
Showing
25 changed files
with
132 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/plate-core': patch | ||
--- | ||
|
||
fix import html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@udecode/plate-indent-list': patch | ||
'@udecode/plate-line-height': patch | ||
'@udecode/plate-code-block': patch | ||
'@udecode/plate-comments': patch | ||
'@udecode/plate-layout': patch | ||
'@udecode/plate-media': patch | ||
'@udecode/plate-table': patch | ||
'@udecode/plate-core': patch | ||
'@udecode/plate-docx': patch | ||
--- | ||
|
||
Remove useless html parser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
packages/code-block/src/lib/deserializer/htmlDeserializerCodeBlockStatic.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
*/ | ||
|
||
export * from './htmlDeserializerCodeBlock'; | ||
export * from './htmlDeserializerCodeBlockStatic'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 20 additions & 5 deletions
25
packages/core/src/lib/plugins/html/utils/deserializeHtmlNodeChildren.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
import type { SlateEditor } from '../../../editor'; | ||
import type { DeserializeHtmlChildren } from '../types'; | ||
|
||
import { isSlateNode } from '../../../static'; | ||
import { deserializeHtmlNode } from './deserializeHtmlNode'; | ||
|
||
export const deserializeHtmlNodeChildren = ( | ||
editor: SlateEditor, | ||
node: ChildNode | HTMLElement | ||
) => | ||
Array.from(node.childNodes).flatMap( | ||
deserializeHtmlNode(editor) | ||
) as DeserializeHtmlChildren[]; | ||
node: ChildNode | HTMLElement, | ||
isSlateParent = false | ||
): DeserializeHtmlChildren[] => { | ||
return Array.from(node.childNodes).flatMap((child) => { | ||
if ( | ||
child.nodeType === 1 && | ||
!isSlateNode(child as HTMLElement) && | ||
isSlateParent | ||
) { | ||
return deserializeHtmlNodeChildren( | ||
editor, | ||
child as HTMLElement, | ||
isSlateParent | ||
); | ||
} | ||
|
||
return deserializeHtmlNode(editor)(child); | ||
}) as DeserializeHtmlChildren[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.