File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/core/src/api/parsers/html Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ async function parseHTMLAndCompareSnapshots(
6
6
html : string ,
7
7
snapshotName : string
8
8
) {
9
+ // use a dynamic import because we want to access
10
+ // __parseFromClipboard which is not exposed in types
9
11
const view : any = await import ( "prosemirror-view" ) ;
10
12
11
13
const editor = BlockNoteEditor . create ( ) ;
Original file line number Diff line number Diff line change @@ -18,12 +18,14 @@ export async function HTMLToBlocks<
18
18
const htmlNode = nestedListsToBlockNoteStructure ( html ) ;
19
19
const parser = DOMParser . fromSchema ( pmSchema ) ;
20
20
21
+ // Other approach might be to use
21
22
// const doc = pmSchema.nodes["doc"].createAndFill()!;
23
+ // and context: doc.resolve(3),
22
24
23
25
const parentNode = parser . parse ( htmlNode , {
24
26
topNode : pmSchema . nodes [ "blockGroup" ] . create ( ) ,
25
- // context: doc.resolve(3),
26
- } ) ; //, { preserveWhitespace: "full" });
27
+ } ) ;
28
+
27
29
const blocks : Block < BSchema , I , S > [ ] = [ ] ;
28
30
29
31
for ( let i = 0 ; i < parentNode . childCount ; i ++ ) {
You can’t perform that action at this time.
0 commit comments