@blocknote/core 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/blocknote.js +3145 -2970
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +9 -9
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +27 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +99 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +97 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +88 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js +116 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +110 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +57 -0
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +5 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +31 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +71 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +157 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +27 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +64 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +145 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +252 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/insertContentAt.js +64 -0
- package/dist/src/api/blockManipulation/insertContentAt.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +76 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +33 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +1 -0
- package/dist/src/api/blockManipulation/setupTestEnv.js +172 -0
- package/dist/src/api/blockManipulation/setupTestEnv.js.map +1 -0
- package/dist/src/api/clipboard/clipboard.test.js +246 -0
- package/dist/src/api/clipboard/clipboard.test.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +8 -0
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +38 -0
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +111 -0
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +26 -0
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +57 -0
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +1 -0
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +132 -0
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +1 -0
- package/dist/src/api/exporters/html/externalHTMLExporter.js +35 -0
- package/dist/src/api/exporters/html/externalHTMLExporter.js.map +1 -0
- package/dist/src/api/exporters/html/htmlConversion.test.js +72 -0
- package/dist/src/api/exporters/html/htmlConversion.test.js.map +1 -0
- package/dist/src/api/exporters/html/internalHTMLSerializer.js +21 -0
- package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +1 -0
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +141 -0
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +1 -0
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +96 -0
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +1 -0
- package/dist/src/api/exporters/markdown/markdownExporter.js +31 -0
- package/dist/src/api/exporters/markdown/markdownExporter.js.map +1 -0
- package/dist/src/api/exporters/markdown/markdownExporter.test.js +57 -0
- package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +1 -0
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +33 -0
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +1 -0
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +37 -0
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +1 -0
- package/dist/src/api/getBlockInfoFromPos.js +165 -0
- package/dist/src/api/getBlockInfoFromPos.js.map +1 -0
- package/dist/src/api/nodeConversions/blockToNode.js +197 -0
- package/dist/src/api/nodeConversions/blockToNode.js.map +1 -0
- package/dist/src/api/nodeConversions/fragmentToBlocks.js +50 -0
- package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +1 -0
- package/dist/src/api/nodeConversions/nodeConversions.test.js +54 -0
- package/dist/src/api/nodeConversions/nodeConversions.test.js.map +1 -0
- package/dist/src/api/nodeConversions/nodeToBlock.js +316 -0
- package/dist/src/api/nodeConversions/nodeToBlock.js.map +1 -0
- package/dist/src/api/nodeUtil.js +28 -0
- package/dist/src/api/nodeUtil.js.map +1 -0
- package/dist/src/api/parsers/html/parseHTML.js +19 -0
- package/dist/src/api/parsers/html/parseHTML.js.map +1 -0
- package/dist/src/api/parsers/html/parseHTML.test.js +470 -0
- package/dist/src/api/parsers/html/parseHTML.test.js.map +1 -0
- package/dist/src/api/parsers/html/util/nestedLists.js +106 -0
- package/dist/src/api/parsers/html/util/nestedLists.js.map +1 -0
- package/dist/src/api/parsers/html/util/nestedLists.test.js +166 -0
- package/dist/src/api/parsers/html/util/nestedLists.test.js.map +1 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.js +52 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.js.map +1 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +109 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +1 -0
- package/dist/src/api/testUtil/cases/customBlocks.js +313 -0
- package/dist/src/api/testUtil/cases/customBlocks.js.map +1 -0
- package/dist/src/api/testUtil/cases/customInlineContent.js +91 -0
- package/dist/src/api/testUtil/cases/customInlineContent.js.map +1 -0
- package/dist/src/api/testUtil/cases/customStyles.js +83 -0
- package/dist/src/api/testUtil/cases/customStyles.js.map +1 -0
- package/dist/src/api/testUtil/cases/defaultSchema.js +673 -0
- package/dist/src/api/testUtil/cases/defaultSchema.js.map +1 -0
- package/dist/src/api/testUtil/index.js +2 -0
- package/dist/src/api/testUtil/index.js.map +1 -0
- package/dist/src/api/testUtil/partialBlockTestUtil.js +114 -0
- package/dist/src/api/testUtil/partialBlockTestUtil.js.map +1 -0
- package/dist/src/api/testUtil/paste.js +29 -0
- package/dist/src/api/testUtil/paste.js.map +1 -0
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +97 -0
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +1 -0
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js +5 -0
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +1 -0
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +273 -0
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +1 -0
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +90 -0
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +70 -0
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +317 -0
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +15 -0
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +1 -0
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +145 -0
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +1 -0
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +106 -0
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +1 -0
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js +6 -0
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +113 -0
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +224 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +45 -0
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +58 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +130 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +52 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +129 -0
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableExtension.js +57 -0
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +1 -0
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +103 -0
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +1 -0
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js +6 -0
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +1 -0
- package/dist/src/blocks/defaultBlockHelpers.js +50 -0
- package/dist/src/blocks/defaultBlockHelpers.js.map +1 -0
- package/dist/src/blocks/defaultBlockTypeGuards.js +40 -0
- package/dist/src/blocks/defaultBlockTypeGuards.js.map +1 -0
- package/dist/src/blocks/defaultBlocks.js +50 -0
- package/dist/src/blocks/defaultBlocks.js.map +1 -0
- package/dist/src/blocks/defaultProps.js +19 -0
- package/dist/src/blocks/defaultProps.js.map +1 -0
- package/dist/src/editor/BlockNoteEditor.js +746 -0
- package/dist/src/editor/BlockNoteEditor.js.map +1 -0
- package/dist/src/editor/BlockNoteEditor.test.js +65 -0
- package/dist/src/editor/BlockNoteEditor.test.js.map +1 -0
- package/dist/src/editor/BlockNoteExtensions.js +195 -0
- package/dist/src/editor/BlockNoteExtensions.js.map +1 -0
- package/dist/src/editor/BlockNoteSchema.js +38 -0
- package/dist/src/editor/BlockNoteSchema.js.map +1 -0
- package/dist/src/editor/BlockNoteTipTapEditor.js +169 -0
- package/dist/src/editor/BlockNoteTipTapEditor.js.map +1 -0
- package/dist/src/editor/cursorPositionTypes.js +2 -0
- package/dist/src/editor/cursorPositionTypes.js.map +1 -0
- package/dist/src/editor/defaultColors.js +77 -0
- package/dist/src/editor/defaultColors.js.map +1 -0
- package/dist/src/editor/selectionTypes.js +2 -0
- package/dist/src/editor/selectionTypes.js.map +1 -0
- package/dist/src/editor/transformPasted.js +79 -0
- package/dist/src/editor/transformPasted.js.map +1 -0
- package/dist/src/exporter/Exporter.js +36 -0
- package/dist/src/exporter/Exporter.js.map +1 -0
- package/dist/src/exporter/index.js +3 -0
- package/dist/src/exporter/index.js.map +1 -0
- package/dist/src/exporter/mapping.js +12 -0
- package/dist/src/exporter/mapping.js.map +1 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +30 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +1 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +39 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +1 -0
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js +131 -0
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +1 -0
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +195 -0
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +1 -0
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +339 -0
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -0
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +247 -0
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +1 -0
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +54 -0
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +84 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -0
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +187 -0
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +1 -0
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +68 -0
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +1 -0
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +339 -0
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +1 -0
- package/dist/src/extensions/SideMenu/dragging.js +128 -0
- package/dist/src/extensions/SideMenu/dragging.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +2 -0
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +2 -0
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +245 -0
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +26 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +244 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +1 -0
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +553 -0
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +1 -0
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +36 -0
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +1 -0
- package/dist/src/extensions/TextColor/TextColorExtension.js +29 -0
- package/dist/src/extensions/TextColor/TextColorExtension.js.map +1 -0
- package/dist/src/extensions/TextColor/TextColorMark.js +37 -0
- package/dist/src/extensions/TextColor/TextColorMark.js.map +1 -0
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +58 -0
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +1 -0
- package/dist/src/extensions/UniqueID/UniqueID.js +283 -0
- package/dist/src/extensions/UniqueID/UniqueID.js.map +1 -0
- package/dist/src/extensions/getDraggableBlockFromElement.js +13 -0
- package/dist/src/extensions/getDraggableBlockFromElement.js.map +1 -0
- package/dist/src/extensions-shared/UiElementPosition.js +2 -0
- package/dist/src/extensions-shared/UiElementPosition.js.map +1 -0
- package/dist/src/i18n/dictionary.js +4 -0
- package/dist/src/i18n/dictionary.js.map +1 -0
- package/dist/src/i18n/locales/ar.js +298 -0
- package/dist/src/i18n/locales/ar.js.map +1 -0
- package/dist/src/i18n/locales/de.js +313 -0
- package/dist/src/i18n/locales/de.js.map +1 -0
- package/dist/src/i18n/locales/en.js +314 -0
- package/dist/src/i18n/locales/en.js.map +1 -0
- package/dist/src/i18n/locales/es.js +312 -0
- package/dist/src/i18n/locales/es.js.map +1 -0
- package/dist/src/i18n/locales/fr.js +313 -0
- package/dist/src/i18n/locales/fr.js.map +1 -0
- package/dist/src/i18n/locales/hr.js +308 -0
- package/dist/src/i18n/locales/hr.js.map +1 -0
- package/dist/src/i18n/locales/index.js +16 -0
- package/dist/src/i18n/locales/index.js.map +1 -0
- package/dist/src/i18n/locales/is.js +305 -0
- package/dist/src/i18n/locales/is.js.map +1 -0
- package/dist/src/i18n/locales/ja.js +333 -0
- package/dist/src/i18n/locales/ja.js.map +1 -0
- package/dist/src/i18n/locales/ko.js +326 -0
- package/dist/src/i18n/locales/ko.js.map +1 -0
- package/dist/src/i18n/locales/nl.js +313 -0
- package/dist/src/i18n/locales/nl.js.map +1 -0
- package/dist/src/i18n/locales/pl.js +297 -0
- package/dist/src/i18n/locales/pl.js.map +1 -0
- package/dist/src/i18n/locales/pt.js +305 -0
- package/dist/src/i18n/locales/pt.js.map +1 -0
- package/dist/src/i18n/locales/ru.js +340 -0
- package/dist/src/i18n/locales/ru.js.map +1 -0
- package/dist/src/i18n/locales/vi.js +312 -0
- package/dist/src/i18n/locales/vi.js.map +1 -0
- package/dist/src/i18n/locales/zh.js +346 -0
- package/dist/src/i18n/locales/zh.js.map +1 -0
- package/dist/src/index.js +55 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/pm-nodes/BlockContainer.js +72 -0
- package/dist/src/pm-nodes/BlockContainer.js.map +1 -0
- package/dist/src/pm-nodes/BlockGroup.js +43 -0
- package/dist/src/pm-nodes/BlockGroup.js.map +1 -0
- package/dist/src/pm-nodes/Doc.js +7 -0
- package/dist/src/pm-nodes/Doc.js.map +1 -0
- package/dist/src/pm-nodes/index.js +4 -0
- package/dist/src/pm-nodes/index.js.map +1 -0
- package/dist/src/schema/blocks/createSpec.js +126 -0
- package/dist/src/schema/blocks/createSpec.js.map +1 -0
- package/dist/src/schema/blocks/internal.js +147 -0
- package/dist/src/schema/blocks/internal.js.map +1 -0
- package/dist/src/schema/blocks/types.js +2 -0
- package/dist/src/schema/blocks/types.js.map +1 -0
- package/dist/src/schema/index.js +11 -0
- package/dist/src/schema/index.js.map +1 -0
- package/dist/src/schema/inlineContent/createSpec.js +64 -0
- package/dist/src/schema/inlineContent/createSpec.js.map +1 -0
- package/dist/src/schema/inlineContent/internal.js +52 -0
- package/dist/src/schema/inlineContent/internal.js.map +1 -0
- package/dist/src/schema/inlineContent/types.js +10 -0
- package/dist/src/schema/inlineContent/types.js.map +1 -0
- package/dist/src/schema/propTypes.js +2 -0
- package/dist/src/schema/propTypes.js.map +1 -0
- package/dist/src/schema/styles/createSpec.js +48 -0
- package/dist/src/schema/styles/createSpec.js.map +1 -0
- package/dist/src/schema/styles/internal.js +53 -0
- package/dist/src/schema/styles/internal.js.map +1 -0
- package/dist/src/schema/styles/types.js +2 -0
- package/dist/src/schema/styles/types.js.map +1 -0
- package/dist/src/util/EventEmitter.js +33 -0
- package/dist/src/util/EventEmitter.js.map +1 -0
- package/dist/src/util/browser.js +17 -0
- package/dist/src/util/browser.js.map +1 -0
- package/dist/src/util/combineByGroup.js +20 -0
- package/dist/src/util/combineByGroup.js.map +1 -0
- package/dist/src/util/esmDependencies.js +35 -0
- package/dist/src/util/esmDependencies.js.map +1 -0
- package/dist/src/util/string.js +14 -0
- package/dist/src/util/string.js.map +1 -0
- package/dist/src/util/typescript.js +12 -0
- package/dist/src/util/typescript.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/webpack-stats.json +1 -1
- package/package.json +5 -5
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -6
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -0
- package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -5
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +2 -2
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +104 -39
- package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +0 -8
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +7 -3
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +3 -5
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +100 -0
- package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +439 -2
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +6 -0
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +2 -82
- package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -8
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +96 -20
- package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -6
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +8 -4
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +13 -12
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -490
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +5 -5
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +192 -107
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +48 -33
- package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +7 -6
- package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
- package/src/api/exporters/html/htmlConversion.test.ts +1 -4
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +56 -19
- package/src/api/exporters/markdown/markdownExporter.test.ts +1 -4
- package/src/api/getBlockInfoFromPos.ts +125 -80
- package/src/api/nodeConversions/blockToNode.ts +50 -25
- package/src/api/nodeConversions/fragmentToBlocks.ts +18 -0
- package/src/api/nodeConversions/nodeToBlock.ts +24 -21
- package/src/api/nodeUtil.ts +1 -1
- package/src/api/parsers/html/__snapshots__/parse-notion-html.json +1 -2
- package/src/api/testUtil/partialBlockTestUtil.ts +15 -3
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +4 -2
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +5 -4
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +35 -35
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +4 -2
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +14 -12
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +28 -16
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +5 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -4
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +13 -11
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +8 -9
- package/src/blocks/TableBlockContent/TableBlockContent.ts +0 -1
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +4 -2
- package/src/blocks/defaultBlockHelpers.ts +7 -2
- package/src/editor/Block.css +22 -1
- package/src/editor/BlockNoteEditor.test.ts +4 -7
- package/src/editor/BlockNoteEditor.ts +87 -61
- package/src/editor/BlockNoteExtensions.ts +92 -17
- package/src/editor/BlockNoteTipTapEditor.ts +8 -1
- package/src/editor/defaultColors.ts +77 -0
- package/src/editor/editor.css +10 -0
- package/src/editor/transformPasted.ts +6 -3
- package/src/exporter/Exporter.ts +101 -0
- package/src/exporter/index.ts +2 -0
- package/src/exporter/mapping.ts +75 -0
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +233 -53
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +94 -90
- package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +173 -169
- package/src/extensions/SideMenu/SideMenuPlugin.ts +141 -52
- package/src/extensions/SideMenu/dragging.ts +3 -54
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -6
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +1 -1
- package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
- package/src/extensions/getDraggableBlockFromElement.ts +19 -0
- package/src/i18n/locales/de.ts +5 -5
- package/src/i18n/locales/pt.ts +5 -5
- package/src/index.ts +9 -5
- package/src/pm-nodes/BlockContainer.ts +1 -1
- package/src/pm-nodes/BlockGroup.ts +2 -2
- package/src/pm-nodes/README.md +127 -28
- package/src/schema/blocks/createSpec.ts +4 -1
- package/src/schema/blocks/internal.ts +12 -2
- package/src/schema/blocks/types.ts +1 -1
- package/src/util/combineByGroup.ts +25 -0
- package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +22 -2
- package/types/src/api/blockManipulation/commands/nestBlock/nestBlock.d.ts +5 -0
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -3
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -0
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +0 -6
- package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
- package/types/src/api/getBlockInfoFromPos.d.ts +38 -13
- package/types/src/api/nodeConversions/blockToNode.d.ts +1 -1
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +3 -1
- package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -6
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -6
- package/types/src/api/testUtil/cases/customStyles.d.ts +0 -6
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +1 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +1 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +1 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -9
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +1 -0
- package/types/src/blocks/defaultBlocks.d.ts +0 -12
- package/types/src/editor/BlockNoteEditor.d.ts +23 -5
- package/types/src/editor/BlockNoteExtensions.d.ts +14 -7
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -0
- package/types/src/editor/defaultColors.d.ts +76 -0
- package/types/src/exporter/Exporter.d.ts +43 -0
- package/types/src/exporter/index.d.ts +2 -0
- package/types/src/exporter/mapping.d.ts +30 -0
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +4 -1
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +4 -1
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +4 -5
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +2 -1
- package/types/src/extensions/SideMenu/dragging.d.ts +1 -6
- package/types/src/extensions/getDraggableBlockFromElement.d.ts +5 -0
- package/types/src/index.d.ts +9 -5
- package/types/src/schema/blocks/createSpec.d.ts +1 -1
- package/types/src/schema/blocks/internal.d.ts +2 -2
- package/types/src/schema/blocks/types.d.ts +1 -1
- package/types/src/util/combineByGroup.d.ts +9 -0
- package/dist/angular-html-HQGguTAE.js +0 -33
- package/dist/angular-html-HQGguTAE.js.map +0 -1
- package/dist/angular-ts-q9PqJiJb.js +0 -22
- package/dist/angular-ts-q9PqJiJb.js.map +0 -1
- package/dist/astro-0iWgpDaK.js +0 -17
- package/dist/astro-0iWgpDaK.js.map +0 -1
- package/dist/blade-C3Z8AhvY.js +0 -19
- package/dist/blade-C3Z8AhvY.js.map +0 -1
- package/dist/c-TKJGJdXV.js +0 -7
- package/dist/c-TKJGJdXV.js.map +0 -1
- package/dist/coffee-CN_y6cG3.js +0 -9
- package/dist/coffee-CN_y6cG3.js.map +0 -1
- package/dist/cpp-Be_e67JE.js +0 -19
- package/dist/cpp-Be_e67JE.js.map +0 -1
- package/dist/css-DHLSoXzW.js +0 -7
- package/dist/css-DHLSoXzW.js.map +0 -1
- package/dist/glsl-8qSUIm5B.js +0 -9
- package/dist/glsl-8qSUIm5B.js.map +0 -1
- package/dist/graphql-D7_Dk2ma.js +0 -15
- package/dist/graphql-D7_Dk2ma.js.map +0 -1
- package/dist/haml-S3dmcfEW.js +0 -11
- package/dist/haml-S3dmcfEW.js.map +0 -1
- package/dist/handlebars-DaIrqVg3.js +0 -15
- package/dist/handlebars-DaIrqVg3.js.map +0 -1
- package/dist/html-Bx3A18fV.js +0 -11
- package/dist/html-Bx3A18fV.js.map +0 -1
- package/dist/html-derivative-Cf3KTZBS.js +0 -9
- package/dist/html-derivative-Cf3KTZBS.js.map +0 -1
- package/dist/http-BphR83YX.js +0 -15
- package/dist/http-BphR83YX.js.map +0 -1
- package/dist/imba-CmP25v0O.js +0 -9
- package/dist/imba-CmP25v0O.js.map +0 -1
- package/dist/java-Dg4kxH6C.js +0 -7
- package/dist/java-Dg4kxH6C.js.map +0 -1
- package/dist/javascript-CipAzIn1.js +0 -7
- package/dist/javascript-CipAzIn1.js.map +0 -1
- package/dist/jinja-tioldiz6.js +0 -12
- package/dist/jinja-tioldiz6.js.map +0 -1
- package/dist/jison-DWJFEE_I.js +0 -9
- package/dist/jison-DWJFEE_I.js.map +0 -1
- package/dist/json-_04EL6MS.js +0 -7
- package/dist/json-_04EL6MS.js.map +0 -1
- package/dist/json5-Dwmp5XFI.js +0 -7
- package/dist/json5-Dwmp5XFI.js.map +0 -1
- package/dist/jsonc-LqD5auy0.js +0 -7
- package/dist/jsonc-LqD5auy0.js.map +0 -1
- package/dist/jsonl-B4yVuYQH.js +0 -7
- package/dist/jsonl-B4yVuYQH.js.map +0 -1
- package/dist/jsx-Mg4WaD5k.js +0 -7
- package/dist/jsx-Mg4WaD5k.js.map +0 -1
- package/dist/julia-CWi-ZdpN.js +0 -17
- package/dist/julia-CWi-ZdpN.js.map +0 -1
- package/dist/less-BBvTHIGe.js +0 -7
- package/dist/less-BBvTHIGe.js.map +0 -1
- package/dist/markdown-DAXqtk9a.js +0 -7
- package/dist/markdown-DAXqtk9a.js.map +0 -1
- package/dist/marko-0aaNgUGV.js +0 -15
- package/dist/marko-0aaNgUGV.js.map +0 -1
- package/dist/mdc-hXJ2B4O0.js +0 -13
- package/dist/mdc-hXJ2B4O0.js.map +0 -1
- package/dist/mdx-CSCKbb_f.js +0 -7
- package/dist/mdx-CSCKbb_f.js.map +0 -1
- package/dist/php-B_-4RJ09.js +0 -19
- package/dist/php-B_-4RJ09.js.map +0 -1
- package/dist/postcss-SJfTvo_B.js +0 -7
- package/dist/postcss-SJfTvo_B.js.map +0 -1
- package/dist/pug-3q2tx0nf.js +0 -13
- package/dist/pug-3q2tx0nf.js.map +0 -1
- package/dist/python-Dpup1-fE.js +0 -7
- package/dist/python-Dpup1-fE.js.map +0 -1
- package/dist/r-Chyv38Fv.js +0 -7
- package/dist/r-Chyv38Fv.js.map +0 -1
- package/dist/regexp-BF0hfxNW.js +0 -7
- package/dist/regexp-BF0hfxNW.js.map +0 -1
- package/dist/sass-p2RMoqDT.js +0 -7
- package/dist/sass-p2RMoqDT.js.map +0 -1
- package/dist/scss-DmlHSoOY.js +0 -9
- package/dist/scss-DmlHSoOY.js.map +0 -1
- package/dist/shellscript-CZpPN8_x.js +0 -7
- package/dist/shellscript-CZpPN8_x.js.map +0 -1
- package/dist/sql-DtlkUz2m.js +0 -7
- package/dist/sql-DtlkUz2m.js.map +0 -1
- package/dist/stylus-DEr8eSLm.js +0 -7
- package/dist/stylus-DEr8eSLm.js.map +0 -1
- package/dist/svelte-BRIJF62h.js +0 -15
- package/dist/svelte-BRIJF62h.js.map +0 -1
- package/dist/ts-tags-qkUtuI0N.js +0 -42
- package/dist/ts-tags-qkUtuI0N.js.map +0 -1
- package/dist/tsx-DTfbgJxi.js +0 -7
- package/dist/tsx-DTfbgJxi.js.map +0 -1
- package/dist/typescript-CCd4aQHh.js +0 -7
- package/dist/typescript-CCd4aQHh.js.map +0 -1
- package/dist/vue-B3TdbERm.js +0 -32
- package/dist/vue-B3TdbERm.js.map +0 -1
- package/dist/vue-html-BGmTBZk0.js +0 -11
- package/dist/vue-html-BGmTBZk0.js.map +0 -1
- package/dist/wasm-VDIDph3E.js +0 -7
- package/dist/wasm-VDIDph3E.js.map +0 -1
- package/dist/wgsl-2np_U3Z8.js +0 -7
- package/dist/wgsl-2np_U3Z8.js.map +0 -1
- package/dist/xml-CNyphW9R.js +0 -9
- package/dist/xml-CNyphW9R.js.map +0 -1
- package/dist/yaml-DxFiVFcM.js +0 -7
- package/dist/yaml-DxFiVFcM.js.map +0 -1
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import * as pmView from "prosemirror-view";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { BlockNoteEditor } from "../../../index.js";
|
|
4
|
+
import { nestedListsToBlockNoteStructure } from "./util/nestedLists.js";
|
|
5
|
+
async function parseHTMLAndCompareSnapshots(html, snapshotName) {
|
|
6
|
+
const editor = BlockNoteEditor.create();
|
|
7
|
+
const div = document.createElement("div");
|
|
8
|
+
editor.mount(div);
|
|
9
|
+
const blocks = await editor.tryParseHTMLToBlocks(html);
|
|
10
|
+
const snapshotPath = "./__snapshots__/" + snapshotName + ".json";
|
|
11
|
+
expect(JSON.stringify(blocks, undefined, 2)).toMatchFileSnapshot(snapshotPath);
|
|
12
|
+
// Now, we also want to test actually pasting in the editor, and not just calling
|
|
13
|
+
// tryParseHTMLToBlocks directly.
|
|
14
|
+
// The reason is that the prosemirror logic for pasting can be a bit different, because
|
|
15
|
+
// it's related to the context of where the user is pasting exactly (selection)
|
|
16
|
+
//
|
|
17
|
+
// The internal difference come that in tryParseHTMLToBlocks, we use DOMParser.parse,
|
|
18
|
+
// while when pasting, Prosemirror uses DOMParser.parseSlice, and then tries to fit the
|
|
19
|
+
// slice in the document. This fitting might change the structure / interpretation of the pasted blocks
|
|
20
|
+
// Simulate a paste event (this uses DOMParser.parseSlice internally)
|
|
21
|
+
window.__TEST_OPTIONS.mockID = 0; // reset id counter
|
|
22
|
+
const htmlNode = nestedListsToBlockNoteStructure(html);
|
|
23
|
+
const slice = pmView.__parseFromClipboard(editor.prosemirrorView, "", htmlNode.innerHTML, false, editor._tiptapEditor.state.selection.$from);
|
|
24
|
+
editor.dispatch(editor._tiptapEditor.state.tr.replaceSelection(slice));
|
|
25
|
+
// alternative paste simulation doesn't work in a non-browser vitest env
|
|
26
|
+
// editor._tiptapEditor.view.pasteHTML(html, {
|
|
27
|
+
// preventDefault: () => {
|
|
28
|
+
// // noop
|
|
29
|
+
// },
|
|
30
|
+
// clipboardData: {
|
|
31
|
+
// types: ["text/html"],
|
|
32
|
+
// getData: () => html,
|
|
33
|
+
// },
|
|
34
|
+
// } as any);
|
|
35
|
+
const pastedBlocks = editor.document;
|
|
36
|
+
pastedBlocks.pop(); // trailing paragraph
|
|
37
|
+
expect(pastedBlocks).toStrictEqual(blocks);
|
|
38
|
+
editor.mount(undefined);
|
|
39
|
+
}
|
|
40
|
+
describe("Parse HTML", () => {
|
|
41
|
+
it("Parse basic block types", async () => {
|
|
42
|
+
const html = `<h1>Heading 1</h1>
|
|
43
|
+
<h2>Heading 2</h2>
|
|
44
|
+
<h3>Heading 3</h3>
|
|
45
|
+
<p>Paragraph</p>
|
|
46
|
+
<figure><img src="exampleURL" /><figcaption>Image Caption</figcaption></figure>
|
|
47
|
+
<p>None <strong>Bold </strong><em>Italic </em><u>Underline </u><s>Strikethrough </s><strong><em><s><u>All</u></s></em></strong></p>`;
|
|
48
|
+
await parseHTMLAndCompareSnapshots(html, "parse-basic-block-types");
|
|
49
|
+
});
|
|
50
|
+
it("list test", async () => {
|
|
51
|
+
const html = `<ul>
|
|
52
|
+
<li>First</li>
|
|
53
|
+
<li>Second</li>
|
|
54
|
+
<li>Third</li>
|
|
55
|
+
<li>
|
|
56
|
+
<input type="checkbox">
|
|
57
|
+
Fourth
|
|
58
|
+
</li>
|
|
59
|
+
<li>
|
|
60
|
+
<input type="checkbox">
|
|
61
|
+
Fifth
|
|
62
|
+
</li>
|
|
63
|
+
<li>Five Parent
|
|
64
|
+
<ul>
|
|
65
|
+
<li>Child 1</li>
|
|
66
|
+
<li>Child 2</li>
|
|
67
|
+
<li>
|
|
68
|
+
<input type="checkbox">
|
|
69
|
+
Child 3
|
|
70
|
+
</li>
|
|
71
|
+
<li>
|
|
72
|
+
<input type="checkbox">
|
|
73
|
+
Child 4
|
|
74
|
+
</li>
|
|
75
|
+
</ul>
|
|
76
|
+
</li>
|
|
77
|
+
</ul>`;
|
|
78
|
+
await parseHTMLAndCompareSnapshots(html, "list-test");
|
|
79
|
+
});
|
|
80
|
+
it("Parse nested lists", async () => {
|
|
81
|
+
const html = `<ul>
|
|
82
|
+
<li>Bullet List Item</li>
|
|
83
|
+
<li>Bullet List Item
|
|
84
|
+
<ul>
|
|
85
|
+
<li>Nested Bullet List Item</li>
|
|
86
|
+
<li>Nested Bullet List Item</li>
|
|
87
|
+
</ul>
|
|
88
|
+
</li>
|
|
89
|
+
<li>Bullet List Item</li>
|
|
90
|
+
</ul>
|
|
91
|
+
<ol>
|
|
92
|
+
<li>Numbered List Item</li>
|
|
93
|
+
<li>Numbered List Item
|
|
94
|
+
<ol>
|
|
95
|
+
<li>Nested Numbered List Item</li>
|
|
96
|
+
<li>Nested Numbered List Item</li>
|
|
97
|
+
</ol>
|
|
98
|
+
</li>
|
|
99
|
+
<li>Numbered List Item</li>
|
|
100
|
+
</ol>
|
|
101
|
+
<ul>
|
|
102
|
+
<li>
|
|
103
|
+
<input type="checkbox">
|
|
104
|
+
Check List Item
|
|
105
|
+
</li>
|
|
106
|
+
<li>
|
|
107
|
+
<input type="checkbox">
|
|
108
|
+
Check List Item
|
|
109
|
+
<ul>
|
|
110
|
+
<li>
|
|
111
|
+
<input type="checkbox">
|
|
112
|
+
Nested Check List Item
|
|
113
|
+
</li>
|
|
114
|
+
<li>
|
|
115
|
+
<input type="checkbox">
|
|
116
|
+
Nested Check List Item
|
|
117
|
+
</li>
|
|
118
|
+
</ul>
|
|
119
|
+
</li>
|
|
120
|
+
<li>
|
|
121
|
+
<input type="checkbox">
|
|
122
|
+
Nested Check List Item
|
|
123
|
+
</li>
|
|
124
|
+
</ul>`;
|
|
125
|
+
await parseHTMLAndCompareSnapshots(html, "parse-nested-lists");
|
|
126
|
+
});
|
|
127
|
+
it("Parse nested lists with paragraphs", async () => {
|
|
128
|
+
const html = `<ul>
|
|
129
|
+
<li>
|
|
130
|
+
<p>Bullet List Item</p>
|
|
131
|
+
</li>
|
|
132
|
+
<li>
|
|
133
|
+
<p>Bullet List Item</p>
|
|
134
|
+
<ul>
|
|
135
|
+
<li>
|
|
136
|
+
<p>Nested Bullet List Item</p>
|
|
137
|
+
</li>
|
|
138
|
+
<li>
|
|
139
|
+
<p>Nested Bullet List Item</p>
|
|
140
|
+
</li>
|
|
141
|
+
</ul>
|
|
142
|
+
</li>
|
|
143
|
+
<li>
|
|
144
|
+
<p>Bullet List Item</p>
|
|
145
|
+
</li>
|
|
146
|
+
</ul>
|
|
147
|
+
<ol>
|
|
148
|
+
<li>
|
|
149
|
+
<p>Numbered List Item</p>
|
|
150
|
+
</li>
|
|
151
|
+
<li>
|
|
152
|
+
<p>Numbered List Item</p>
|
|
153
|
+
<ol>
|
|
154
|
+
<li>
|
|
155
|
+
<p>Nested Numbered List Item</p>
|
|
156
|
+
</li>
|
|
157
|
+
<li>
|
|
158
|
+
<p>Nested Numbered List Item</p>
|
|
159
|
+
</li>
|
|
160
|
+
</ol>
|
|
161
|
+
</li>
|
|
162
|
+
<li>
|
|
163
|
+
<p>Numbered List Item</p>
|
|
164
|
+
</li>
|
|
165
|
+
</ol>
|
|
166
|
+
<ul>
|
|
167
|
+
<li>
|
|
168
|
+
<input type="checkbox">
|
|
169
|
+
<p>Checked List Item</p>
|
|
170
|
+
</li>
|
|
171
|
+
<li>
|
|
172
|
+
<input type="checkbox">
|
|
173
|
+
<p>Checked List Item</p>
|
|
174
|
+
<ul>
|
|
175
|
+
<li>
|
|
176
|
+
<input type="checkbox">
|
|
177
|
+
<p>Nested Checked List Item</p>
|
|
178
|
+
</li>
|
|
179
|
+
<li>
|
|
180
|
+
<label><input type="checkbox"></label>
|
|
181
|
+
<p>Nested Checked List Item</p>
|
|
182
|
+
</li>
|
|
183
|
+
</ul>
|
|
184
|
+
</li>
|
|
185
|
+
<li>
|
|
186
|
+
<input type="checkbox">
|
|
187
|
+
<p>Checked List Item</p>
|
|
188
|
+
</li>
|
|
189
|
+
</ul>`;
|
|
190
|
+
await parseHTMLAndCompareSnapshots(html, "parse-nested-lists-with-paragraphs");
|
|
191
|
+
});
|
|
192
|
+
it("Parse mixed nested lists", async () => {
|
|
193
|
+
const html = `<ul>
|
|
194
|
+
<li>Bullet List Item</li>
|
|
195
|
+
<li>Bullet List Item
|
|
196
|
+
<ol>
|
|
197
|
+
<li>Nested Numbered List Item</li>
|
|
198
|
+
<li>Nested Numbered List Item</li>
|
|
199
|
+
</ol>
|
|
200
|
+
</li>
|
|
201
|
+
<li>Bullet List Item</li>
|
|
202
|
+
</ul>
|
|
203
|
+
<ol>
|
|
204
|
+
<li>Numbered List Item</li>
|
|
205
|
+
<li>Numbered List Item
|
|
206
|
+
<ul>
|
|
207
|
+
<li>
|
|
208
|
+
<input type="checkbox" checked>
|
|
209
|
+
Nested Check List Item
|
|
210
|
+
</li>
|
|
211
|
+
<li>
|
|
212
|
+
<input type="checkbox">
|
|
213
|
+
Nested Check List Item
|
|
214
|
+
</li>
|
|
215
|
+
</ul>
|
|
216
|
+
</li>
|
|
217
|
+
<li>Numbered List Item</li>
|
|
218
|
+
</ol>
|
|
219
|
+
<ul>
|
|
220
|
+
<li>
|
|
221
|
+
<input type="checkbox" checked>
|
|
222
|
+
Check List Item
|
|
223
|
+
</li>
|
|
224
|
+
<li>
|
|
225
|
+
<input type="checkbox">
|
|
226
|
+
Check List Item
|
|
227
|
+
<ul>
|
|
228
|
+
<li>Nested Bullet List Item</li>
|
|
229
|
+
<li>Nested Bullet List Item</li>
|
|
230
|
+
</ul>
|
|
231
|
+
</li>
|
|
232
|
+
<li>
|
|
233
|
+
<input type="checkbox" checked>
|
|
234
|
+
Nested Check List Item
|
|
235
|
+
</li>
|
|
236
|
+
</ul>`;
|
|
237
|
+
await parseHTMLAndCompareSnapshots(html, "parse-mixed-nested-lists");
|
|
238
|
+
});
|
|
239
|
+
it("Parse divs", async () => {
|
|
240
|
+
const html = `<div>Single Div</div>
|
|
241
|
+
<div>
|
|
242
|
+
Div
|
|
243
|
+
<div>Nested Div</div>
|
|
244
|
+
<div>Nested Div</div>
|
|
245
|
+
</div>
|
|
246
|
+
<div>Single Div 2</div>
|
|
247
|
+
<div>
|
|
248
|
+
<div>Nested Div</div>
|
|
249
|
+
<div>Nested Div</div>
|
|
250
|
+
</div>`;
|
|
251
|
+
await parseHTMLAndCompareSnapshots(html, "parse-divs");
|
|
252
|
+
});
|
|
253
|
+
it("Parse two divs", async () => {
|
|
254
|
+
const html = `<div>Single Div</div><div>second Div</div>`;
|
|
255
|
+
await parseHTMLAndCompareSnapshots(html, "parse-two-divs");
|
|
256
|
+
});
|
|
257
|
+
it("Parse image in paragraph", async () => {
|
|
258
|
+
const html = `<p>
|
|
259
|
+
<img src="exampleURL">
|
|
260
|
+
</p>`;
|
|
261
|
+
await parseHTMLAndCompareSnapshots(html, "parse-image-in-paragraph");
|
|
262
|
+
});
|
|
263
|
+
it("Parse fake image caption", async () => {
|
|
264
|
+
const html = `<div>
|
|
265
|
+
<img src="exampleURL">
|
|
266
|
+
<p>Image Caption</p>
|
|
267
|
+
</div>`;
|
|
268
|
+
await parseHTMLAndCompareSnapshots(html, "parse-fake-image-caption");
|
|
269
|
+
});
|
|
270
|
+
// TODO: this one fails
|
|
271
|
+
it.skip("Parse deep nested content", async () => {
|
|
272
|
+
const html = `<div>
|
|
273
|
+
Outer 1 Div Before
|
|
274
|
+
<div>
|
|
275
|
+
Outer 2 Div Before
|
|
276
|
+
<div>
|
|
277
|
+
Outer 3 Div Before
|
|
278
|
+
<div>
|
|
279
|
+
Outer 4 Div Before
|
|
280
|
+
<h1>Heading 1</h1>
|
|
281
|
+
<h2>Heading 2</h2>
|
|
282
|
+
<h3>Heading 3</h3>
|
|
283
|
+
<p>Paragraph</p>
|
|
284
|
+
<figure><img src="exampleURL"><figcaption>Image Caption</figcaption></figure>
|
|
285
|
+
<p><strong>Bold</strong> <em>Italic</em> <u>Underline</u> <s>Strikethrough</s> <strong><em><s><u>All</u></s></em></strong></p>
|
|
286
|
+
Outer 4 Div After
|
|
287
|
+
</div>
|
|
288
|
+
Outer 3 Div After
|
|
289
|
+
</div>
|
|
290
|
+
Outer 2 Div After
|
|
291
|
+
</div>
|
|
292
|
+
Outer 1 Div After
|
|
293
|
+
</div>`;
|
|
294
|
+
await parseHTMLAndCompareSnapshots(html, "parse-deep-nested-content");
|
|
295
|
+
});
|
|
296
|
+
it("Parse div with inline content and nested blocks", async () => {
|
|
297
|
+
const html = `<div>
|
|
298
|
+
None <strong>Bold </strong><em>Italic </em><u>Underline </u><s>Strikethrough </s><strong><em><s><u>All</u></s></em></strong>
|
|
299
|
+
<div>Nested Div</div>
|
|
300
|
+
<p>Nested Paragraph</p>
|
|
301
|
+
</div>`;
|
|
302
|
+
await parseHTMLAndCompareSnapshots(html, "parse-div-with-inline-content");
|
|
303
|
+
});
|
|
304
|
+
it("Parse Notion HTML", async () => {
|
|
305
|
+
// A few notes on Notion output HTML:
|
|
306
|
+
// - Does not preserve text/background colors
|
|
307
|
+
// - Does not preserve non-list-item block nesting
|
|
308
|
+
// - Hard breaks are represented using white space, not `<br>` elements
|
|
309
|
+
// - Images are converted to links with a "!" at the start
|
|
310
|
+
// - Cells in first row of a table are converted to `th` elements, regardless
|
|
311
|
+
// of if the row is set as a header row
|
|
312
|
+
const html = `<meta charset='utf-8'><h1>Heading 1</h1>
|
|
313
|
+
<h2>Heading 2</h2>
|
|
314
|
+
<h3>Heading 3</h3>
|
|
315
|
+
<p>Paragraph 1</p>
|
|
316
|
+
<p>Nested Paragraph 1</p>
|
|
317
|
+
<p>Nested Paragraph 2</p>
|
|
318
|
+
<p>Paragraph
|
|
319
|
+
With Hard Break</p>
|
|
320
|
+
<p><strong>Bold</strong> <em>Italic</em> Underline <s>Strikethrough</s> <em><strong><s>All</s></strong></em></p>
|
|
321
|
+
<ul>
|
|
322
|
+
<li>Bullet List Item 1
|
|
323
|
+
<ul>
|
|
324
|
+
<li>Nested Bullet List Item 1
|
|
325
|
+
<ol>
|
|
326
|
+
<li>Nested Numbered List Item 1</li>
|
|
327
|
+
<li>Nested Numbered List Item 2</li>
|
|
328
|
+
</ol>
|
|
329
|
+
</li>
|
|
330
|
+
<li>Nested Bullet List Item 2</li>
|
|
331
|
+
</ul>
|
|
332
|
+
</li>
|
|
333
|
+
<li>Bullet List Item 2</li>
|
|
334
|
+
</ul>
|
|
335
|
+
<ol>
|
|
336
|
+
<li>Numbered List Item 1</li>
|
|
337
|
+
<li>Numbered List Item 2</li>
|
|
338
|
+
</ol>
|
|
339
|
+
<p>Background Color Paragraph</p>
|
|
340
|
+
<p>!<a href="https://www.pulsecarshalton.co.uk/wp-content/uploads/2016/08/jk-placeholder-image.jpg">https://www.pulsecarshalton.co.uk/wp-content/uploads/2016/08/jk-placeholder-image.jpg</a></p>
|
|
341
|
+
<table>
|
|
342
|
+
<thead>
|
|
343
|
+
<tr>
|
|
344
|
+
<th>Cell 1</th>
|
|
345
|
+
<th>Cell 2</th>
|
|
346
|
+
<th>Cell 3</th>
|
|
347
|
+
</tr>
|
|
348
|
+
</thead>
|
|
349
|
+
<tbody>
|
|
350
|
+
<tr>
|
|
351
|
+
<td>Cell 4</td>
|
|
352
|
+
<td>Cell 5</td>
|
|
353
|
+
<td>Cell 6</td>
|
|
354
|
+
</tr>
|
|
355
|
+
<tr>
|
|
356
|
+
<td>Cell 7</td>
|
|
357
|
+
<td>Cell 8</td>
|
|
358
|
+
<td>Cell 9</td>
|
|
359
|
+
</tr>
|
|
360
|
+
</tbody>
|
|
361
|
+
</table>
|
|
362
|
+
<p>Paragraph</p>
|
|
363
|
+
<!-- notionvc: 7cb7968f-b969-4795-af7a-d41b5481c675 -->`;
|
|
364
|
+
await parseHTMLAndCompareSnapshots(html, "parse-notion-html");
|
|
365
|
+
});
|
|
366
|
+
// Currently breaking, seems related to parsing `</br>` elements
|
|
367
|
+
it.skip("Parse Google Docs HTML", async () => {
|
|
368
|
+
// A few notes on Google Docs output HTML:
|
|
369
|
+
// - All inline markup is represented as `<span>` elements with inline
|
|
370
|
+
// styles (bold, italic, etc.)
|
|
371
|
+
// - The nested list structure is not valid, i.e. `<ul/ol>` elements are not
|
|
372
|
+
// placed within `<li>` elements
|
|
373
|
+
// - Images are wrapped in two spans and a paragraph
|
|
374
|
+
// - Everything is nested within a `<b>` element
|
|
375
|
+
const html = `<meta charset='utf-8'>
|
|
376
|
+
<meta charset="utf-8">
|
|
377
|
+
<b style="font-weight:normal;" id="docs-internal-guid-fdf86189-7fff-f50a-2bef-c048469db8a9">
|
|
378
|
+
<h1 dir="ltr" style="line-height:1.38;margin-left: 18pt;text-indent: -18pt;margin-top:24pt;margin-bottom:6pt;padding:0pt 0pt 0pt 18pt;"><span style="font-size:23pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Heading 1</span></h1>
|
|
379
|
+
<h2 dir="ltr" style="line-height:1.38;margin-left: 18pt;text-indent: -18pt;margin-top:18pt;margin-bottom:4pt;padding:0pt 0pt 0pt 18pt;"><span style="font-size:17pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Heading 2</span></h2>
|
|
380
|
+
<h3 dir="ltr" style="line-height:1.38;margin-left: 18pt;text-indent: -18pt;margin-top:14pt;margin-bottom:4pt;padding:0pt 0pt 0pt 18pt;"><span style="font-size:13pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Heading 3</span></h3>
|
|
381
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Paragraph 1</span></p>
|
|
382
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Paragraph 2</span></p>
|
|
383
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Paragraph 3</span></p>
|
|
384
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Paragraph With </span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"><br /></span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hard Break</span></p>
|
|
385
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Bold</span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"> </span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:italic;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Italic</span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"> Underline </span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:line-through;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Strikethrough</span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"> </span><span style="font-size:11pt;font-family:Arial,sans-serif;color:#ff0000;background-color:transparent;font-weight:700;font-style:italic;font-variant:normal;text-decoration:line-through;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">All</span></p>
|
|
386
|
+
<ul style="margin-top:0;margin-bottom:0;padding-inline-start:48px;">
|
|
387
|
+
<li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1">
|
|
388
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Bullet List Item 1</span></p>
|
|
389
|
+
</li>
|
|
390
|
+
<ul style="margin-top:0;margin-bottom:0;padding-inline-start:48px;">
|
|
391
|
+
<li dir="ltr" style="list-style-type:circle;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2">
|
|
392
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Nested Bullet List Item 1</span></p>
|
|
393
|
+
</li>
|
|
394
|
+
<ol style="margin-top:0;margin-bottom:0;padding-inline-start:48px;">
|
|
395
|
+
<li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="3">
|
|
396
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Nested Numbered List Item 1</span></p>
|
|
397
|
+
</li>
|
|
398
|
+
<li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="3">
|
|
399
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Nested Numbered List Item 2</span></p>
|
|
400
|
+
</li>
|
|
401
|
+
</ol>
|
|
402
|
+
<li dir="ltr" style="list-style-type:circle;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="2">
|
|
403
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Nested Bullet List Item 2</span></p>
|
|
404
|
+
</li>
|
|
405
|
+
</ul>
|
|
406
|
+
<li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1">
|
|
407
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Bullet List Item 2</span></p>
|
|
408
|
+
</li>
|
|
409
|
+
</ul>
|
|
410
|
+
<ol style="margin-top:0;margin-bottom:0;padding-inline-start:48px;">
|
|
411
|
+
<li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1">
|
|
412
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Numbered List Item 1</span></p>
|
|
413
|
+
</li>
|
|
414
|
+
<li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;" aria-level="1">
|
|
415
|
+
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:12pt;" role="presentation"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Numbered List Item 2</span></p>
|
|
416
|
+
</li>
|
|
417
|
+
</ol>
|
|
418
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"><span style="border:none;display:inline-block;overflow:hidden;width:447px;height:301px;"><img src="https://lh7-us.googleusercontent.com/SGyYp6hfLvNkli62NKFJB6NQz-fNa2Sjy8QxfUuqipW--qCCXmCz-dJmeZUGaDXIF9TEZHzbhNJsw4_w-B09eaFOn0oUChKsrSt3cwAIFu6d4SoSjHTR_DRTPr415_P7an7Lue-EwlUcVBk1WCzcoVQ" width="447" height="301" style="margin-left:0px;margin-top:0px;" /></span></span></p>
|
|
419
|
+
<br />
|
|
420
|
+
<div dir="ltr" style="margin-left:0pt;" align="left">
|
|
421
|
+
<table style="border:none;border-collapse:collapse;table-layout:fixed;width:468pt">
|
|
422
|
+
<colgroup>
|
|
423
|
+
<col />
|
|
424
|
+
<col />
|
|
425
|
+
<col />
|
|
426
|
+
</colgroup>
|
|
427
|
+
<tbody>
|
|
428
|
+
<tr style="height:0pt">
|
|
429
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
430
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 1</span></p>
|
|
431
|
+
</td>
|
|
432
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
433
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 2</span></p>
|
|
434
|
+
</td>
|
|
435
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
436
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 3</span></p>
|
|
437
|
+
</td>
|
|
438
|
+
</tr>
|
|
439
|
+
<tr style="height:0pt">
|
|
440
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
441
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 4</span></p>
|
|
442
|
+
</td>
|
|
443
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
444
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 5</span></p>
|
|
445
|
+
</td>
|
|
446
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
447
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 6</span></p>
|
|
448
|
+
</td>
|
|
449
|
+
</tr>
|
|
450
|
+
<tr style="height:0pt">
|
|
451
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
452
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 7</span></p>
|
|
453
|
+
</td>
|
|
454
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
455
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 8</span></p>
|
|
456
|
+
</td>
|
|
457
|
+
<td style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
|
|
458
|
+
<p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Cell 9</span></p>
|
|
459
|
+
</td>
|
|
460
|
+
</tr>
|
|
461
|
+
</tbody>
|
|
462
|
+
</table>
|
|
463
|
+
</div>
|
|
464
|
+
<p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt;"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Paragraph</span></p>
|
|
465
|
+
</b>
|
|
466
|
+
<br class="Apple-interchange-newline">`;
|
|
467
|
+
await parseHTMLAndCompareSnapshots(html, "parse-google-docs-html");
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
//# sourceMappingURL=parseHTML.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseHTML.test.js","sourceRoot":"","sources":["../../../../../src/api/parsers/html/parseHTML.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAA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IAAI,EAAE;QACjC,qCAAqC;QACrC,6CAA6C;QAC7C,kDAAkD;QAClD,uEAAuE;QACvE,0DAA0D;QAC1D,6EAA6E;QAC7E,uCAAuC;QAEvC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAmDuC,CAAC;QAErD,MAAM,4BAA4B,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAChE,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QAC3C,0CAA0C;QAC1C,sEAAsE;QACtE,8BAA8B;QAC9B,4EAA4E;QAC5E,gCAAgC;QAChC,oDAAoD;QACpD,gDAAgD;QAEhD,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA2FsB,CAAC;QAEpC,MAAM,4BAA4B,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function getChildIndex(node) {
|
|
2
|
+
return Array.prototype.indexOf.call(node.parentElement.childNodes, node);
|
|
3
|
+
}
|
|
4
|
+
function isWhitespaceNode(node) {
|
|
5
|
+
return node.nodeType === 3 && !/\S/.test(node.nodeValue || "");
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Step 1, Turns:
|
|
9
|
+
*
|
|
10
|
+
* <ul>
|
|
11
|
+
* <li>item</li>
|
|
12
|
+
* <li>
|
|
13
|
+
* <ul>
|
|
14
|
+
* <li>...</li>
|
|
15
|
+
* <li>...</li>
|
|
16
|
+
* </ul>
|
|
17
|
+
* </li>
|
|
18
|
+
*
|
|
19
|
+
* Into:
|
|
20
|
+
* <ul>
|
|
21
|
+
* <li>item</li>
|
|
22
|
+
* <ul>
|
|
23
|
+
* <li>...</li>
|
|
24
|
+
* <li>...</li>
|
|
25
|
+
* </ul>
|
|
26
|
+
* </ul>
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
function liftNestedListsToParent(element) {
|
|
30
|
+
element.querySelectorAll("li > ul, li > ol").forEach((list) => {
|
|
31
|
+
const index = getChildIndex(list);
|
|
32
|
+
const parentListItem = list.parentElement;
|
|
33
|
+
const siblingsAfter = Array.from(parentListItem.childNodes).slice(index + 1);
|
|
34
|
+
list.remove();
|
|
35
|
+
siblingsAfter.forEach((sibling) => {
|
|
36
|
+
sibling.remove();
|
|
37
|
+
});
|
|
38
|
+
parentListItem.insertAdjacentElement("afterend", list);
|
|
39
|
+
siblingsAfter.reverse().forEach((sibling) => {
|
|
40
|
+
if (isWhitespaceNode(sibling)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const siblingContainer = document.createElement("li");
|
|
44
|
+
siblingContainer.append(sibling);
|
|
45
|
+
list.insertAdjacentElement("afterend", siblingContainer);
|
|
46
|
+
});
|
|
47
|
+
if (parentListItem.childNodes.length === 0) {
|
|
48
|
+
parentListItem.remove();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Step 2, Turns (output of liftNestedListsToParent):
|
|
54
|
+
*
|
|
55
|
+
* <li>item</li>
|
|
56
|
+
* <ul>
|
|
57
|
+
* <li>...</li>
|
|
58
|
+
* <li>...</li>
|
|
59
|
+
* </ul>
|
|
60
|
+
*
|
|
61
|
+
* Into:
|
|
62
|
+
* <div>
|
|
63
|
+
* <li>item</li>
|
|
64
|
+
* <div data-node-type="blockGroup">
|
|
65
|
+
* <ul>
|
|
66
|
+
* <li>...</li>
|
|
67
|
+
* <li>...</li>
|
|
68
|
+
* </ul>
|
|
69
|
+
* </div>
|
|
70
|
+
* </div>
|
|
71
|
+
*
|
|
72
|
+
* This resulting format is parsed
|
|
73
|
+
*/
|
|
74
|
+
function createGroups(element) {
|
|
75
|
+
element.querySelectorAll("li + ul, li + ol").forEach((list) => {
|
|
76
|
+
const listItem = list.previousElementSibling;
|
|
77
|
+
const blockContainer = document.createElement("div");
|
|
78
|
+
listItem.insertAdjacentElement("afterend", blockContainer);
|
|
79
|
+
blockContainer.append(listItem);
|
|
80
|
+
const blockGroup = document.createElement("div");
|
|
81
|
+
blockGroup.setAttribute("data-node-type", "blockGroup");
|
|
82
|
+
blockContainer.append(blockGroup);
|
|
83
|
+
while (blockContainer.nextElementSibling?.nodeName === "UL" ||
|
|
84
|
+
blockContainer.nextElementSibling?.nodeName === "OL") {
|
|
85
|
+
blockGroup.append(blockContainer.nextElementSibling);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// prevent XSS, similar to https://github.com/ProseMirror/prosemirror-view/blob/1251b2b412656a2a06263e4187574beb43651273/src/clipboard.ts#L204
|
|
90
|
+
// https://github.com/TypeCellOS/BlockNote/issues/601
|
|
91
|
+
let _detachedDoc = null;
|
|
92
|
+
function detachedDoc() {
|
|
93
|
+
return (_detachedDoc ||
|
|
94
|
+
(_detachedDoc = document.implementation.createHTMLDocument("title")));
|
|
95
|
+
}
|
|
96
|
+
export function nestedListsToBlockNoteStructure(elementOrHTML) {
|
|
97
|
+
if (typeof elementOrHTML === "string") {
|
|
98
|
+
const element = detachedDoc().createElement("div");
|
|
99
|
+
element.innerHTML = elementOrHTML;
|
|
100
|
+
elementOrHTML = element;
|
|
101
|
+
}
|
|
102
|
+
liftNestedListsToParent(elementOrHTML);
|
|
103
|
+
createGroups(elementOrHTML);
|
|
104
|
+
return elementOrHTML;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=nestedLists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestedLists.js","sourceRoot":"","sources":["../../../../../../src/api/parsers/html/util/nestedLists.ts"],"names":[],"mappings":"AAAA,SAAS,a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