@akinon/ui-editor 1.0.0
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/dist/cjs/__tests__/index.test.d.ts +2 -0
- package/dist/cjs/__tests__/index.test.d.ts.map +1 -0
- package/dist/cjs/__tests__/index.test.js +38 -0
- package/dist/cjs/__tests__/index.test.tsx +51 -0
- package/dist/cjs/i18n/index.d.ts +3 -0
- package/dist/cjs/i18n/index.d.ts.map +1 -0
- package/dist/cjs/i18n/index.js +11 -0
- package/dist/cjs/i18n/translations/en.d.ts +86 -0
- package/dist/cjs/i18n/translations/en.d.ts.map +1 -0
- package/dist/cjs/i18n/translations/en.js +85 -0
- package/dist/cjs/i18n/translations/tr.d.ts +86 -0
- package/dist/cjs/i18n/translations/tr.d.ts.map +1 -0
- package/dist/cjs/i18n/translations/tr.js +85 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/tiptap/assets/__tests__/icons.test.d.ts +2 -0
- package/dist/cjs/tiptap/assets/__tests__/icons.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/assets/__tests__/icons.test.js +25 -0
- package/dist/cjs/tiptap/assets/__tests__/icons.test.tsx +29 -0
- package/dist/cjs/tiptap/assets/icons.d.ts +3 -0
- package/dist/cjs/tiptap/assets/icons.d.ts.map +1 -0
- package/dist/cjs/tiptap/assets/icons.js +3 -0
- package/dist/cjs/tiptap/components/__tests__/format-bubble-menu.test.d.ts +6 -0
- package/dist/cjs/tiptap/components/__tests__/format-bubble-menu.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/format-bubble-menu.test.js +311 -0
- package/dist/cjs/tiptap/components/__tests__/format-bubble-menu.test.tsx +452 -0
- package/dist/cjs/tiptap/components/__tests__/html-code-viewer.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/__tests__/html-code-viewer.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/html-code-viewer.test.js +89 -0
- package/dist/cjs/tiptap/components/__tests__/html-code-viewer.test.tsx +126 -0
- package/dist/cjs/tiptap/components/__tests__/image-upload-placeholder.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/__tests__/image-upload-placeholder.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/image-upload-placeholder.test.js +206 -0
- package/dist/cjs/tiptap/components/__tests__/image-upload-placeholder.test.tsx +297 -0
- package/dist/cjs/tiptap/components/__tests__/secure-script-component.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/__tests__/secure-script-component.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/secure-script-component.test.js +57 -0
- package/dist/cjs/tiptap/components/__tests__/secure-script-component.test.tsx +89 -0
- package/dist/cjs/tiptap/components/__tests__/table-bubble-menu.test.d.ts +6 -0
- package/dist/cjs/tiptap/components/__tests__/table-bubble-menu.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/table-bubble-menu.test.js +284 -0
- package/dist/cjs/tiptap/components/__tests__/table-bubble-menu.test.tsx +466 -0
- package/dist/cjs/tiptap/components/__tests__/table-popover.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/__tests__/table-popover.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/table-popover.test.js +101 -0
- package/dist/cjs/tiptap/components/__tests__/table-popover.test.tsx +157 -0
- package/dist/cjs/tiptap/components/__tests__/tiptap.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/__tests__/tiptap.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/__tests__/tiptap.test.js +275 -0
- package/dist/cjs/tiptap/components/__tests__/tiptap.test.tsx +378 -0
- package/dist/cjs/tiptap/components/format-bubble-menu.d.ts +8 -0
- package/dist/cjs/tiptap/components/format-bubble-menu.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/format-bubble-menu.js +202 -0
- package/dist/cjs/tiptap/components/html-code-viewer.d.ts +10 -0
- package/dist/cjs/tiptap/components/html-code-viewer.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/html-code-viewer.js +96 -0
- package/dist/cjs/tiptap/components/image-upload-placeholder.d.ts +4 -0
- package/dist/cjs/tiptap/components/image-upload-placeholder.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/image-upload-placeholder.js +94 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/action-toolbar.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/action-toolbar.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/action-toolbar.test.js +78 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/action-toolbar.test.tsx +212 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.d.ts +3 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.js +201 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.tsx +411 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/heading-selector.test.d.ts +4 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/heading-selector.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/heading-selector.test.js +242 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/heading-selector.test.tsx +569 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/index.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/index.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/index.test.js +236 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/index.test.tsx +325 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/link-popover.test.d.ts +3 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/link-popover.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/link-popover.test.js +332 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/link-popover.test.tsx +648 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.js +196 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.tsx +414 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/media-toolbar.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/media-toolbar.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/media-toolbar.test.js +74 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/media-toolbar.test.tsx +206 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.d.ts +2 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.js +265 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.tsx +575 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/youtube-popover.test.d.ts +3 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/youtube-popover.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/youtube-popover.test.js +277 -0
- package/dist/cjs/tiptap/components/menu-bar/__tests__/youtube-popover.test.tsx +538 -0
- package/dist/cjs/tiptap/components/menu-bar/action-toolbar.d.ts +15 -0
- package/dist/cjs/tiptap/components/menu-bar/action-toolbar.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/action-toolbar.js +40 -0
- package/dist/cjs/tiptap/components/menu-bar/alignment-toolbar.d.ts +12 -0
- package/dist/cjs/tiptap/components/menu-bar/alignment-toolbar.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/alignment-toolbar.js +39 -0
- package/dist/cjs/tiptap/components/menu-bar/heading-selector.d.ts +16 -0
- package/dist/cjs/tiptap/components/menu-bar/heading-selector.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/heading-selector.js +70 -0
- package/dist/cjs/tiptap/components/menu-bar/index.d.ts +18 -0
- package/dist/cjs/tiptap/components/menu-bar/index.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/index.js +131 -0
- package/dist/cjs/tiptap/components/menu-bar/link-popover.d.ts +12 -0
- package/dist/cjs/tiptap/components/menu-bar/link-popover.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/link-popover.js +108 -0
- package/dist/cjs/tiptap/components/menu-bar/list-and-block-toolbar.d.ts +18 -0
- package/dist/cjs/tiptap/components/menu-bar/list-and-block-toolbar.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/list-and-block-toolbar.js +69 -0
- package/dist/cjs/tiptap/components/menu-bar/media-toolbar.d.ts +13 -0
- package/dist/cjs/tiptap/components/menu-bar/media-toolbar.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/media-toolbar.js +15 -0
- package/dist/cjs/tiptap/components/menu-bar/text-formatting-toolbar.d.ts +18 -0
- package/dist/cjs/tiptap/components/menu-bar/text-formatting-toolbar.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/text-formatting-toolbar.js +87 -0
- package/dist/cjs/tiptap/components/menu-bar/youtube-popover.d.ts +12 -0
- package/dist/cjs/tiptap/components/menu-bar/youtube-popover.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/menu-bar/youtube-popover.js +70 -0
- package/dist/cjs/tiptap/components/secure-script-component.d.ts +3 -0
- package/dist/cjs/tiptap/components/secure-script-component.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/secure-script-component.js +61 -0
- package/dist/cjs/tiptap/components/table-bubble-menu.d.ts +9 -0
- package/dist/cjs/tiptap/components/table-bubble-menu.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/table-bubble-menu.js +274 -0
- package/dist/cjs/tiptap/components/table-popover.d.ts +10 -0
- package/dist/cjs/tiptap/components/table-popover.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/table-popover.js +86 -0
- package/dist/cjs/tiptap/components/tiptap.d.ts +4 -0
- package/dist/cjs/tiptap/components/tiptap.d.ts.map +1 -0
- package/dist/cjs/tiptap/components/tiptap.js +311 -0
- package/dist/cjs/tiptap/constants/__tests__/table-defaults.test.d.ts +2 -0
- package/dist/cjs/tiptap/constants/__tests__/table-defaults.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/constants/__tests__/table-defaults.test.js +56 -0
- package/dist/cjs/tiptap/constants/__tests__/table-defaults.test.ts +69 -0
- package/dist/cjs/tiptap/constants/editor-config.d.ts +89 -0
- package/dist/cjs/tiptap/constants/editor-config.d.ts.map +1 -0
- package/dist/cjs/tiptap/constants/editor-config.js +103 -0
- package/dist/cjs/tiptap/constants/html-elements.d.ts +95 -0
- package/dist/cjs/tiptap/constants/html-elements.d.ts.map +1 -0
- package/dist/cjs/tiptap/constants/html-elements.js +158 -0
- package/dist/cjs/tiptap/constants/index.d.ts +4 -0
- package/dist/cjs/tiptap/constants/index.d.ts.map +1 -0
- package/dist/cjs/tiptap/constants/index.js +3 -0
- package/dist/cjs/tiptap/constants/table-defaults.d.ts +14 -0
- package/dist/cjs/tiptap/constants/table-defaults.d.ts.map +1 -0
- package/dist/cjs/tiptap/constants/table-defaults.js +18 -0
- package/dist/cjs/tiptap/extensions/__tests__/comment-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/comment-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/comment-extension.test.js +75 -0
- package/dist/cjs/tiptap/extensions/__tests__/comment-extension.test.ts +84 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-cell-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-cell-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-cell-extension.test.js +116 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-cell-extension.test.ts +147 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-cell-extension.test.tsx +90 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-header-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-header-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-header-extension.test.js +183 -0
- package/dist/cjs/tiptap/extensions/__tests__/custom-table-header-extension.test.ts +213 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-block-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-block-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-block-extension.test.js +103 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-block-extension.test.ts +117 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-inline-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-inline-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-inline-extension.test.js +105 -0
- package/dist/cjs/tiptap/extensions/__tests__/html-inline-extension.test.ts +119 -0
- package/dist/cjs/tiptap/extensions/__tests__/iframe-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/iframe-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/iframe-extension.test.js +262 -0
- package/dist/cjs/tiptap/extensions/__tests__/iframe-extension.test.ts +297 -0
- package/dist/cjs/tiptap/extensions/__tests__/image-upload-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/image-upload-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/image-upload-extension.test.js +52 -0
- package/dist/cjs/tiptap/extensions/__tests__/image-upload-extension.test.tsx +65 -0
- package/dist/cjs/tiptap/extensions/__tests__/index.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/index.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/index.test.js +24 -0
- package/dist/cjs/tiptap/extensions/__tests__/index.test.ts +26 -0
- package/dist/cjs/tiptap/extensions/__tests__/reset-marks-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/reset-marks-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/reset-marks-extension.test.js +53 -0
- package/dist/cjs/tiptap/extensions/__tests__/reset-marks-extension.test.ts +74 -0
- package/dist/cjs/tiptap/extensions/__tests__/secure-script-extension.test.d.ts +2 -0
- package/dist/cjs/tiptap/extensions/__tests__/secure-script-extension.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/__tests__/secure-script-extension.test.js +27 -0
- package/dist/cjs/tiptap/extensions/__tests__/secure-script-extension.test.tsx +32 -0
- package/dist/cjs/tiptap/extensions/comment-extension.d.ts +13 -0
- package/dist/cjs/tiptap/extensions/comment-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/comment-extension.js +47 -0
- package/dist/cjs/tiptap/extensions/custom-table-cell-extension.d.ts +10 -0
- package/dist/cjs/tiptap/extensions/custom-table-cell-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/custom-table-cell-extension.js +64 -0
- package/dist/cjs/tiptap/extensions/custom-table-header-extension.d.ts +10 -0
- package/dist/cjs/tiptap/extensions/custom-table-header-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/custom-table-header-extension.js +63 -0
- package/dist/cjs/tiptap/extensions/html-block-extension.d.ts +6 -0
- package/dist/cjs/tiptap/extensions/html-block-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/html-block-extension.js +90 -0
- package/dist/cjs/tiptap/extensions/html-inline-extension.d.ts +6 -0
- package/dist/cjs/tiptap/extensions/html-inline-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/html-inline-extension.js +87 -0
- package/dist/cjs/tiptap/extensions/iframe-extension.d.ts +18 -0
- package/dist/cjs/tiptap/extensions/iframe-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/iframe-extension.js +170 -0
- package/dist/cjs/tiptap/extensions/image-upload-extension.d.ts +3 -0
- package/dist/cjs/tiptap/extensions/image-upload-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/image-upload-extension.js +29 -0
- package/dist/cjs/tiptap/extensions/index.d.ts +10 -0
- package/dist/cjs/tiptap/extensions/index.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/index.js +9 -0
- package/dist/cjs/tiptap/extensions/reset-marks-extension.d.ts +3 -0
- package/dist/cjs/tiptap/extensions/reset-marks-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/reset-marks-extension.js +17 -0
- package/dist/cjs/tiptap/extensions/secure-script-extension.d.ts +3 -0
- package/dist/cjs/tiptap/extensions/secure-script-extension.d.ts.map +1 -0
- package/dist/cjs/tiptap/extensions/secure-script-extension.js +55 -0
- package/dist/cjs/tiptap/types/index.d.ts +232 -0
- package/dist/cjs/tiptap/types/index.d.ts.map +1 -0
- package/dist/cjs/tiptap/types/index.js +1 -0
- package/dist/cjs/tiptap/utils/__tests__/format-html.test.d.ts +2 -0
- package/dist/cjs/tiptap/utils/__tests__/format-html.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/__tests__/format-html.test.js +68 -0
- package/dist/cjs/tiptap/utils/__tests__/format-html.test.ts +91 -0
- package/dist/cjs/tiptap/utils/__tests__/highlight-html.test.d.ts +2 -0
- package/dist/cjs/tiptap/utils/__tests__/highlight-html.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/__tests__/highlight-html.test.js +71 -0
- package/dist/cjs/tiptap/utils/__tests__/highlight-html.test.ts +100 -0
- package/dist/cjs/tiptap/utils/__tests__/index.test.d.ts +2 -0
- package/dist/cjs/tiptap/utils/__tests__/index.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/__tests__/index.test.js +13 -0
- package/dist/cjs/tiptap/utils/__tests__/index.test.ts +15 -0
- package/dist/cjs/tiptap/utils/__tests__/normalize-html.test.d.ts +2 -0
- package/dist/cjs/tiptap/utils/__tests__/normalize-html.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/__tests__/normalize-html.test.js +53 -0
- package/dist/cjs/tiptap/utils/__tests__/normalize-html.test.ts +77 -0
- package/dist/cjs/tiptap/utils/__tests__/tiptap-extensions.test.d.ts +2 -0
- package/dist/cjs/tiptap/utils/__tests__/tiptap-extensions.test.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/__tests__/tiptap-extensions.test.js +209 -0
- package/dist/cjs/tiptap/utils/__tests__/tiptap-extensions.test.ts +299 -0
- package/dist/cjs/tiptap/utils/format-html.d.ts +6 -0
- package/dist/cjs/tiptap/utils/format-html.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/format-html.js +108 -0
- package/dist/cjs/tiptap/utils/highlight-html.d.ts +6 -0
- package/dist/cjs/tiptap/utils/highlight-html.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/highlight-html.js +82 -0
- package/dist/cjs/tiptap/utils/index.d.ts +5 -0
- package/dist/cjs/tiptap/utils/index.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/index.js +4 -0
- package/dist/cjs/tiptap/utils/normalize-html.d.ts +7 -0
- package/dist/cjs/tiptap/utils/normalize-html.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/normalize-html.js +109 -0
- package/dist/cjs/tiptap/utils/tiptap-extensions.d.ts +21 -0
- package/dist/cjs/tiptap/utils/tiptap-extensions.d.ts.map +1 -0
- package/dist/cjs/tiptap/utils/tiptap-extensions.js +198 -0
- package/dist/esm/__tests__/index.test.d.ts +2 -0
- package/dist/esm/__tests__/index.test.d.ts.map +1 -0
- package/dist/esm/__tests__/index.test.js +38 -0
- package/dist/esm/__tests__/index.test.tsx +51 -0
- package/dist/esm/i18n/index.d.ts +3 -0
- package/dist/esm/i18n/index.d.ts.map +1 -0
- package/dist/esm/i18n/index.js +11 -0
- package/dist/esm/i18n/translations/en.d.ts +86 -0
- package/dist/esm/i18n/translations/en.d.ts.map +1 -0
- package/dist/esm/i18n/translations/en.js +85 -0
- package/dist/esm/i18n/translations/tr.d.ts +86 -0
- package/dist/esm/i18n/translations/tr.d.ts.map +1 -0
- package/dist/esm/i18n/translations/tr.js +85 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/tiptap/assets/__tests__/icons.test.d.ts +2 -0
- package/dist/esm/tiptap/assets/__tests__/icons.test.d.ts.map +1 -0
- package/dist/esm/tiptap/assets/__tests__/icons.test.js +25 -0
- package/dist/esm/tiptap/assets/__tests__/icons.test.tsx +29 -0
- package/dist/esm/tiptap/assets/icons.d.ts +3 -0
- package/dist/esm/tiptap/assets/icons.d.ts.map +1 -0
- package/dist/esm/tiptap/assets/icons.js +3 -0
- package/dist/esm/tiptap/components/__tests__/format-bubble-menu.test.d.ts +6 -0
- package/dist/esm/tiptap/components/__tests__/format-bubble-menu.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/format-bubble-menu.test.js +311 -0
- package/dist/esm/tiptap/components/__tests__/format-bubble-menu.test.tsx +452 -0
- package/dist/esm/tiptap/components/__tests__/html-code-viewer.test.d.ts +2 -0
- package/dist/esm/tiptap/components/__tests__/html-code-viewer.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/html-code-viewer.test.js +89 -0
- package/dist/esm/tiptap/components/__tests__/html-code-viewer.test.tsx +126 -0
- package/dist/esm/tiptap/components/__tests__/image-upload-placeholder.test.d.ts +2 -0
- package/dist/esm/tiptap/components/__tests__/image-upload-placeholder.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/image-upload-placeholder.test.js +206 -0
- package/dist/esm/tiptap/components/__tests__/image-upload-placeholder.test.tsx +297 -0
- package/dist/esm/tiptap/components/__tests__/secure-script-component.test.d.ts +2 -0
- package/dist/esm/tiptap/components/__tests__/secure-script-component.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/secure-script-component.test.js +57 -0
- package/dist/esm/tiptap/components/__tests__/secure-script-component.test.tsx +89 -0
- package/dist/esm/tiptap/components/__tests__/table-bubble-menu.test.d.ts +6 -0
- package/dist/esm/tiptap/components/__tests__/table-bubble-menu.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/table-bubble-menu.test.js +284 -0
- package/dist/esm/tiptap/components/__tests__/table-bubble-menu.test.tsx +466 -0
- package/dist/esm/tiptap/components/__tests__/table-popover.test.d.ts +2 -0
- package/dist/esm/tiptap/components/__tests__/table-popover.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/table-popover.test.js +101 -0
- package/dist/esm/tiptap/components/__tests__/table-popover.test.tsx +157 -0
- package/dist/esm/tiptap/components/__tests__/tiptap.test.d.ts +2 -0
- package/dist/esm/tiptap/components/__tests__/tiptap.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/__tests__/tiptap.test.js +275 -0
- package/dist/esm/tiptap/components/__tests__/tiptap.test.tsx +378 -0
- package/dist/esm/tiptap/components/format-bubble-menu.d.ts +8 -0
- package/dist/esm/tiptap/components/format-bubble-menu.d.ts.map +1 -0
- package/dist/esm/tiptap/components/format-bubble-menu.js +202 -0
- package/dist/esm/tiptap/components/html-code-viewer.d.ts +10 -0
- package/dist/esm/tiptap/components/html-code-viewer.d.ts.map +1 -0
- package/dist/esm/tiptap/components/html-code-viewer.js +96 -0
- package/dist/esm/tiptap/components/image-upload-placeholder.d.ts +4 -0
- package/dist/esm/tiptap/components/image-upload-placeholder.d.ts.map +1 -0
- package/dist/esm/tiptap/components/image-upload-placeholder.js +94 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/action-toolbar.test.d.ts +2 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/action-toolbar.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/action-toolbar.test.js +78 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/action-toolbar.test.tsx +212 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.d.ts +3 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.js +201 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/alignment-toolbar.test.tsx +411 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/heading-selector.test.d.ts +4 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/heading-selector.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/heading-selector.test.js +242 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/heading-selector.test.tsx +569 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/index.test.d.ts +2 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/index.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/index.test.js +236 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/index.test.tsx +325 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/link-popover.test.d.ts +3 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/link-popover.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/link-popover.test.js +332 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/link-popover.test.tsx +648 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.d.ts +2 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.js +196 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/list-and-block-toolbar.test.tsx +414 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/media-toolbar.test.d.ts +2 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/media-toolbar.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/media-toolbar.test.js +74 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/media-toolbar.test.tsx +206 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.d.ts +2 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.js +265 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/text-formatting-toolbar.test.tsx +575 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/youtube-popover.test.d.ts +3 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/youtube-popover.test.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/youtube-popover.test.js +277 -0
- package/dist/esm/tiptap/components/menu-bar/__tests__/youtube-popover.test.tsx +538 -0
- package/dist/esm/tiptap/components/menu-bar/action-toolbar.d.ts +15 -0
- package/dist/esm/tiptap/components/menu-bar/action-toolbar.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/action-toolbar.js +40 -0
- package/dist/esm/tiptap/components/menu-bar/alignment-toolbar.d.ts +12 -0
- package/dist/esm/tiptap/components/menu-bar/alignment-toolbar.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/alignment-toolbar.js +39 -0
- package/dist/esm/tiptap/components/menu-bar/heading-selector.d.ts +16 -0
- package/dist/esm/tiptap/components/menu-bar/heading-selector.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/heading-selector.js +70 -0
- package/dist/esm/tiptap/components/menu-bar/index.d.ts +18 -0
- package/dist/esm/tiptap/components/menu-bar/index.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/index.js +131 -0
- package/dist/esm/tiptap/components/menu-bar/link-popover.d.ts +12 -0
- package/dist/esm/tiptap/components/menu-bar/link-popover.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/link-popover.js +108 -0
- package/dist/esm/tiptap/components/menu-bar/list-and-block-toolbar.d.ts +18 -0
- package/dist/esm/tiptap/components/menu-bar/list-and-block-toolbar.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/list-and-block-toolbar.js +69 -0
- package/dist/esm/tiptap/components/menu-bar/media-toolbar.d.ts +13 -0
- package/dist/esm/tiptap/components/menu-bar/media-toolbar.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/media-toolbar.js +15 -0
- package/dist/esm/tiptap/components/menu-bar/text-formatting-toolbar.d.ts +18 -0
- package/dist/esm/tiptap/components/menu-bar/text-formatting-toolbar.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/text-formatting-toolbar.js +87 -0
- package/dist/esm/tiptap/components/menu-bar/youtube-popover.d.ts +12 -0
- package/dist/esm/tiptap/components/menu-bar/youtube-popover.d.ts.map +1 -0
- package/dist/esm/tiptap/components/menu-bar/youtube-popover.js +70 -0
- package/dist/esm/tiptap/components/secure-script-component.d.ts +3 -0
- package/dist/esm/tiptap/components/secure-script-component.d.ts.map +1 -0
- package/dist/esm/tiptap/components/secure-script-component.js +61 -0
- package/dist/esm/tiptap/components/table-bubble-menu.d.ts +9 -0
- package/dist/esm/tiptap/components/table-bubble-menu.d.ts.map +1 -0
- package/dist/esm/tiptap/components/table-bubble-menu.js +274 -0
- package/dist/esm/tiptap/components/table-popover.d.ts +10 -0
- package/dist/esm/tiptap/components/table-popover.d.ts.map +1 -0
- package/dist/esm/tiptap/components/table-popover.js +86 -0
- package/dist/esm/tiptap/components/tiptap.d.ts +4 -0
- package/dist/esm/tiptap/components/tiptap.d.ts.map +1 -0
- package/dist/esm/tiptap/components/tiptap.js +311 -0
- package/dist/esm/tiptap/constants/__tests__/table-defaults.test.d.ts +2 -0
- package/dist/esm/tiptap/constants/__tests__/table-defaults.test.d.ts.map +1 -0
- package/dist/esm/tiptap/constants/__tests__/table-defaults.test.js +56 -0
- package/dist/esm/tiptap/constants/__tests__/table-defaults.test.ts +69 -0
- package/dist/esm/tiptap/constants/editor-config.d.ts +89 -0
- package/dist/esm/tiptap/constants/editor-config.d.ts.map +1 -0
- package/dist/esm/tiptap/constants/editor-config.js +103 -0
- package/dist/esm/tiptap/constants/html-elements.d.ts +95 -0
- package/dist/esm/tiptap/constants/html-elements.d.ts.map +1 -0
- package/dist/esm/tiptap/constants/html-elements.js +158 -0
- package/dist/esm/tiptap/constants/index.d.ts +4 -0
- package/dist/esm/tiptap/constants/index.d.ts.map +1 -0
- package/dist/esm/tiptap/constants/index.js +3 -0
- package/dist/esm/tiptap/constants/table-defaults.d.ts +14 -0
- package/dist/esm/tiptap/constants/table-defaults.d.ts.map +1 -0
- package/dist/esm/tiptap/constants/table-defaults.js +18 -0
- package/dist/esm/tiptap/extensions/__tests__/comment-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/comment-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/comment-extension.test.js +75 -0
- package/dist/esm/tiptap/extensions/__tests__/comment-extension.test.ts +84 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-cell-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-cell-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-cell-extension.test.js +116 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-cell-extension.test.ts +147 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-cell-extension.test.tsx +90 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-header-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-header-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-header-extension.test.js +183 -0
- package/dist/esm/tiptap/extensions/__tests__/custom-table-header-extension.test.ts +213 -0
- package/dist/esm/tiptap/extensions/__tests__/html-block-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/html-block-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/html-block-extension.test.js +103 -0
- package/dist/esm/tiptap/extensions/__tests__/html-block-extension.test.ts +117 -0
- package/dist/esm/tiptap/extensions/__tests__/html-inline-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/html-inline-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/html-inline-extension.test.js +105 -0
- package/dist/esm/tiptap/extensions/__tests__/html-inline-extension.test.ts +119 -0
- package/dist/esm/tiptap/extensions/__tests__/iframe-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/iframe-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/iframe-extension.test.js +262 -0
- package/dist/esm/tiptap/extensions/__tests__/iframe-extension.test.ts +297 -0
- package/dist/esm/tiptap/extensions/__tests__/image-upload-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/image-upload-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/image-upload-extension.test.js +52 -0
- package/dist/esm/tiptap/extensions/__tests__/image-upload-extension.test.tsx +65 -0
- package/dist/esm/tiptap/extensions/__tests__/index.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/index.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/index.test.js +24 -0
- package/dist/esm/tiptap/extensions/__tests__/index.test.ts +26 -0
- package/dist/esm/tiptap/extensions/__tests__/reset-marks-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/reset-marks-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/reset-marks-extension.test.js +53 -0
- package/dist/esm/tiptap/extensions/__tests__/reset-marks-extension.test.ts +74 -0
- package/dist/esm/tiptap/extensions/__tests__/secure-script-extension.test.d.ts +2 -0
- package/dist/esm/tiptap/extensions/__tests__/secure-script-extension.test.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/__tests__/secure-script-extension.test.js +27 -0
- package/dist/esm/tiptap/extensions/__tests__/secure-script-extension.test.tsx +32 -0
- package/dist/esm/tiptap/extensions/comment-extension.d.ts +13 -0
- package/dist/esm/tiptap/extensions/comment-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/comment-extension.js +47 -0
- package/dist/esm/tiptap/extensions/custom-table-cell-extension.d.ts +10 -0
- package/dist/esm/tiptap/extensions/custom-table-cell-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/custom-table-cell-extension.js +64 -0
- package/dist/esm/tiptap/extensions/custom-table-header-extension.d.ts +10 -0
- package/dist/esm/tiptap/extensions/custom-table-header-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/custom-table-header-extension.js +63 -0
- package/dist/esm/tiptap/extensions/html-block-extension.d.ts +6 -0
- package/dist/esm/tiptap/extensions/html-block-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/html-block-extension.js +90 -0
- package/dist/esm/tiptap/extensions/html-inline-extension.d.ts +6 -0
- package/dist/esm/tiptap/extensions/html-inline-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/html-inline-extension.js +87 -0
- package/dist/esm/tiptap/extensions/iframe-extension.d.ts +18 -0
- package/dist/esm/tiptap/extensions/iframe-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/iframe-extension.js +170 -0
- package/dist/esm/tiptap/extensions/image-upload-extension.d.ts +3 -0
- package/dist/esm/tiptap/extensions/image-upload-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/image-upload-extension.js +29 -0
- package/dist/esm/tiptap/extensions/index.d.ts +10 -0
- package/dist/esm/tiptap/extensions/index.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/index.js +9 -0
- package/dist/esm/tiptap/extensions/reset-marks-extension.d.ts +3 -0
- package/dist/esm/tiptap/extensions/reset-marks-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/reset-marks-extension.js +17 -0
- package/dist/esm/tiptap/extensions/secure-script-extension.d.ts +3 -0
- package/dist/esm/tiptap/extensions/secure-script-extension.d.ts.map +1 -0
- package/dist/esm/tiptap/extensions/secure-script-extension.js +55 -0
- package/dist/esm/tiptap/types/index.d.ts +232 -0
- package/dist/esm/tiptap/types/index.d.ts.map +1 -0
- package/dist/esm/tiptap/types/index.js +1 -0
- package/dist/esm/tiptap/utils/__tests__/format-html.test.d.ts +2 -0
- package/dist/esm/tiptap/utils/__tests__/format-html.test.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/__tests__/format-html.test.js +68 -0
- package/dist/esm/tiptap/utils/__tests__/format-html.test.ts +91 -0
- package/dist/esm/tiptap/utils/__tests__/highlight-html.test.d.ts +2 -0
- package/dist/esm/tiptap/utils/__tests__/highlight-html.test.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/__tests__/highlight-html.test.js +71 -0
- package/dist/esm/tiptap/utils/__tests__/highlight-html.test.ts +100 -0
- package/dist/esm/tiptap/utils/__tests__/index.test.d.ts +2 -0
- package/dist/esm/tiptap/utils/__tests__/index.test.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/__tests__/index.test.js +13 -0
- package/dist/esm/tiptap/utils/__tests__/index.test.ts +15 -0
- package/dist/esm/tiptap/utils/__tests__/normalize-html.test.d.ts +2 -0
- package/dist/esm/tiptap/utils/__tests__/normalize-html.test.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/__tests__/normalize-html.test.js +53 -0
- package/dist/esm/tiptap/utils/__tests__/normalize-html.test.ts +77 -0
- package/dist/esm/tiptap/utils/__tests__/tiptap-extensions.test.d.ts +2 -0
- package/dist/esm/tiptap/utils/__tests__/tiptap-extensions.test.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/__tests__/tiptap-extensions.test.js +209 -0
- package/dist/esm/tiptap/utils/__tests__/tiptap-extensions.test.ts +299 -0
- package/dist/esm/tiptap/utils/format-html.d.ts +6 -0
- package/dist/esm/tiptap/utils/format-html.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/format-html.js +108 -0
- package/dist/esm/tiptap/utils/highlight-html.d.ts +6 -0
- package/dist/esm/tiptap/utils/highlight-html.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/highlight-html.js +82 -0
- package/dist/esm/tiptap/utils/index.d.ts +5 -0
- package/dist/esm/tiptap/utils/index.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/index.js +4 -0
- package/dist/esm/tiptap/utils/normalize-html.d.ts +7 -0
- package/dist/esm/tiptap/utils/normalize-html.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/normalize-html.js +109 -0
- package/dist/esm/tiptap/utils/tiptap-extensions.d.ts +21 -0
- package/dist/esm/tiptap/utils/tiptap-extensions.d.ts.map +1 -0
- package/dist/esm/tiptap/utils/tiptap-extensions.js +198 -0
- package/package.json +99 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-html.test.d.ts","sourceRoot":"","sources":["../../../../../src/tiptap/utils/__tests__/format-html.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { formatHtml } from '../format-html';
|
|
3
|
+
describe('formatHtml', () => {
|
|
4
|
+
it('should format simple nested divs with indentation', () => {
|
|
5
|
+
const input = '<div><div>content</div></div>';
|
|
6
|
+
const expected = `
|
|
7
|
+
<div>
|
|
8
|
+
<div>content</div>
|
|
9
|
+
</div>
|
|
10
|
+
`.trim();
|
|
11
|
+
expect(formatHtml(input)).toBe(expected);
|
|
12
|
+
});
|
|
13
|
+
it('should handle attributes correctly', () => {
|
|
14
|
+
const input = '<div class="foo" id="bar">content</div>';
|
|
15
|
+
expect(formatHtml(input)).toBe(input.trim());
|
|
16
|
+
});
|
|
17
|
+
it('should handle void elements like br and hr', () => {
|
|
18
|
+
const input = '<div>text<br />more text<hr /></div>';
|
|
19
|
+
const output = formatHtml(input);
|
|
20
|
+
expect(output).toContain('<br />');
|
|
21
|
+
expect(output).toContain('<hr />');
|
|
22
|
+
});
|
|
23
|
+
it('should preserve whitespace in pre tags', () => {
|
|
24
|
+
const input = '<pre> keep this space </pre>';
|
|
25
|
+
expect(formatHtml(input)).toBe(input.trim());
|
|
26
|
+
});
|
|
27
|
+
it('should ensure newline before block elements', () => {
|
|
28
|
+
const input = '<span>text</span><div>block</div>';
|
|
29
|
+
const expected = `
|
|
30
|
+
<span>text</span>
|
|
31
|
+
<div>block</div>
|
|
32
|
+
`.trim();
|
|
33
|
+
expect(formatHtml(input)).toBe(expected);
|
|
34
|
+
});
|
|
35
|
+
it('should dedent script content', () => {
|
|
36
|
+
const input = `<script>
|
|
37
|
+
function foo() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
</script>`;
|
|
41
|
+
const output = formatHtml(input);
|
|
42
|
+
expect(output).toContain('function foo() {');
|
|
43
|
+
expect(output).toContain(' return true;');
|
|
44
|
+
});
|
|
45
|
+
it('should handle empty script tags', () => {
|
|
46
|
+
const input = '<script></script>';
|
|
47
|
+
expect(formatHtml(input)).toBe(input);
|
|
48
|
+
});
|
|
49
|
+
it('should convert comment spans back to HTML comments', () => {
|
|
50
|
+
const input = '<span data-type="comment" data-content=" my comment "></span>';
|
|
51
|
+
const expected = '<!-- my comment -->';
|
|
52
|
+
expect(formatHtml(input)).toBe(expected);
|
|
53
|
+
const inputMissingContent = '<span data-type="comment"></span>';
|
|
54
|
+
const expectedMissingContent = '<!---->';
|
|
55
|
+
expect(formatHtml(inputMissingContent)).toBe(expectedMissingContent);
|
|
56
|
+
});
|
|
57
|
+
it('should handle scripts with empty lines', () => {
|
|
58
|
+
const input = `<script>
|
|
59
|
+
var a = 1;
|
|
60
|
+
|
|
61
|
+
var b = 2;
|
|
62
|
+
</script>`;
|
|
63
|
+
const output = formatHtml(input);
|
|
64
|
+
expect(output).toContain('var a = 1;');
|
|
65
|
+
expect(output).toContain('var b = 2;');
|
|
66
|
+
expect(output).toMatch(/;\n\s*var b/);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { formatHtml } from '../format-html';
|
|
4
|
+
|
|
5
|
+
describe('formatHtml', () => {
|
|
6
|
+
it('should format simple nested divs with indentation', () => {
|
|
7
|
+
const input = '<div><div>content</div></div>';
|
|
8
|
+
const expected = `
|
|
9
|
+
<div>
|
|
10
|
+
<div>content</div>
|
|
11
|
+
</div>
|
|
12
|
+
`.trim();
|
|
13
|
+
|
|
14
|
+
expect(formatHtml(input)).toBe(expected);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should handle attributes correctly', () => {
|
|
18
|
+
const input = '<div class="foo" id="bar">content</div>';
|
|
19
|
+
|
|
20
|
+
expect(formatHtml(input)).toBe(input.trim());
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should handle void elements like br and hr', () => {
|
|
24
|
+
const input = '<div>text<br />more text<hr /></div>';
|
|
25
|
+
const output = formatHtml(input);
|
|
26
|
+
|
|
27
|
+
expect(output).toContain('<br />');
|
|
28
|
+
expect(output).toContain('<hr />');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should preserve whitespace in pre tags', () => {
|
|
32
|
+
const input = '<pre> keep this space </pre>';
|
|
33
|
+
|
|
34
|
+
expect(formatHtml(input)).toBe(input.trim());
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should ensure newline before block elements', () => {
|
|
38
|
+
const input = '<span>text</span><div>block</div>';
|
|
39
|
+
const expected = `
|
|
40
|
+
<span>text</span>
|
|
41
|
+
<div>block</div>
|
|
42
|
+
`.trim();
|
|
43
|
+
expect(formatHtml(input)).toBe(expected);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should dedent script content', () => {
|
|
47
|
+
const input = `<script>
|
|
48
|
+
function foo() {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
</script>`;
|
|
52
|
+
|
|
53
|
+
const output = formatHtml(input);
|
|
54
|
+
|
|
55
|
+
expect(output).toContain('function foo() {');
|
|
56
|
+
expect(output).toContain(' return true;');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should handle empty script tags', () => {
|
|
60
|
+
const input = '<script></script>';
|
|
61
|
+
|
|
62
|
+
expect(formatHtml(input)).toBe(input);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should convert comment spans back to HTML comments', () => {
|
|
66
|
+
const input =
|
|
67
|
+
'<span data-type="comment" data-content=" my comment "></span>';
|
|
68
|
+
const expected = '<!-- my comment -->';
|
|
69
|
+
|
|
70
|
+
expect(formatHtml(input)).toBe(expected);
|
|
71
|
+
|
|
72
|
+
const inputMissingContent = '<span data-type="comment"></span>';
|
|
73
|
+
const expectedMissingContent = '<!---->';
|
|
74
|
+
|
|
75
|
+
expect(formatHtml(inputMissingContent)).toBe(expectedMissingContent);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should handle scripts with empty lines', () => {
|
|
79
|
+
const input = `<script>
|
|
80
|
+
var a = 1;
|
|
81
|
+
|
|
82
|
+
var b = 2;
|
|
83
|
+
</script>`;
|
|
84
|
+
|
|
85
|
+
const output = formatHtml(input);
|
|
86
|
+
|
|
87
|
+
expect(output).toContain('var a = 1;');
|
|
88
|
+
expect(output).toContain('var b = 2;');
|
|
89
|
+
expect(output).toMatch(/;\n\s*var b/);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight-html.test.d.ts","sourceRoot":"","sources":["../../../../../src/tiptap/utils/__tests__/highlight-html.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { highlightHtml } from '../highlight-html';
|
|
3
|
+
describe('highlightHtml', () => {
|
|
4
|
+
it('should highlight doctype', () => {
|
|
5
|
+
const input = '<!DOCTYPE html>';
|
|
6
|
+
const output = highlightHtml(input);
|
|
7
|
+
expect(output).toContain('<span class="html-doctype"><!DOCTYPE html></span>');
|
|
8
|
+
});
|
|
9
|
+
it('should highlight comments', () => {
|
|
10
|
+
const input = '<!-- comment -->';
|
|
11
|
+
const output = highlightHtml(input);
|
|
12
|
+
expect(output).toContain('<span class="html-comment"><!-- comment --></span>');
|
|
13
|
+
});
|
|
14
|
+
it('should highlight tags', () => {
|
|
15
|
+
const input = '<div></div>';
|
|
16
|
+
const output = highlightHtml(input);
|
|
17
|
+
expect(output).toContain('<span class="html-tag">div</span>');
|
|
18
|
+
expect(output).toContain('<');
|
|
19
|
+
expect(output).toContain('>');
|
|
20
|
+
});
|
|
21
|
+
it('should highlight self-closing tags', () => {
|
|
22
|
+
const input = '<br />';
|
|
23
|
+
const output = highlightHtml(input);
|
|
24
|
+
expect(output).toContain('<span class="html-tag">br</span>');
|
|
25
|
+
expect(output).toContain('/>');
|
|
26
|
+
});
|
|
27
|
+
it('should highlight attributes and values', () => {
|
|
28
|
+
const input = '<div class="foo" id=\'bar\' disabled>';
|
|
29
|
+
const output = highlightHtml(input);
|
|
30
|
+
expect(output).toContain('<span class="html-attr">class</span>');
|
|
31
|
+
expect(output).toContain('<span class="html-attr">id</span>');
|
|
32
|
+
expect(output).toContain('<span class="html-attr">disabled</span>');
|
|
33
|
+
expect(output).toContain('<span class="html-value">"foo"</span>');
|
|
34
|
+
expect(output).toContain('<span class="html-value">\'bar\'</span>');
|
|
35
|
+
});
|
|
36
|
+
it('should highlight unquoted attribute values', () => {
|
|
37
|
+
const input = '<div data-val=123>';
|
|
38
|
+
const output = highlightHtml(input);
|
|
39
|
+
expect(output).toContain('<span class="html-value">123</span>');
|
|
40
|
+
const inputEmpty = '<div data-val=>';
|
|
41
|
+
const outputEmpty = highlightHtml(inputEmpty);
|
|
42
|
+
expect(outputEmpty).toContain('<span class="html-attr">data-val</span>=<span class="html-value"></span>');
|
|
43
|
+
});
|
|
44
|
+
it('should highlight string literals in text content', () => {
|
|
45
|
+
const input = 'var x = "hello" + \'world\';';
|
|
46
|
+
const output = highlightHtml(input);
|
|
47
|
+
expect(output).toContain('<span class="html-string">"hello"</span>');
|
|
48
|
+
expect(output).toContain('<span class="html-string">\'world\'</span>');
|
|
49
|
+
});
|
|
50
|
+
it('should escape HTML entities in text content', () => {
|
|
51
|
+
const input = '<span>1 < 2 & 3 > 2</span>';
|
|
52
|
+
const output = highlightHtml(input);
|
|
53
|
+
expect(output).toContain('1 < 2 & 3 > 2');
|
|
54
|
+
});
|
|
55
|
+
it('should handle complex mixed content', () => {
|
|
56
|
+
const input = `
|
|
57
|
+
<!DOCTYPE html>
|
|
58
|
+
<!-- start -->
|
|
59
|
+
<div class="container">
|
|
60
|
+
Text with "quotes"
|
|
61
|
+
</div>
|
|
62
|
+
`.trim();
|
|
63
|
+
const output = highlightHtml(input);
|
|
64
|
+
expect(output).toContain('html-doctype');
|
|
65
|
+
expect(output).toContain('html-comment');
|
|
66
|
+
expect(output).toContain('html-tag');
|
|
67
|
+
expect(output).toContain('html-attr');
|
|
68
|
+
expect(output).toContain('html-value');
|
|
69
|
+
expect(output).toContain('html-string');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { highlightHtml } from '../highlight-html';
|
|
4
|
+
|
|
5
|
+
describe('highlightHtml', () => {
|
|
6
|
+
it('should highlight doctype', () => {
|
|
7
|
+
const input = '<!DOCTYPE html>';
|
|
8
|
+
const output = highlightHtml(input);
|
|
9
|
+
|
|
10
|
+
expect(output).toContain(
|
|
11
|
+
'<span class="html-doctype"><!DOCTYPE html></span>'
|
|
12
|
+
);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should highlight comments', () => {
|
|
16
|
+
const input = '<!-- comment -->';
|
|
17
|
+
const output = highlightHtml(input);
|
|
18
|
+
|
|
19
|
+
expect(output).toContain(
|
|
20
|
+
'<span class="html-comment"><!-- comment --></span>'
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should highlight tags', () => {
|
|
25
|
+
const input = '<div></div>';
|
|
26
|
+
const output = highlightHtml(input);
|
|
27
|
+
|
|
28
|
+
expect(output).toContain('<span class="html-tag">div</span>');
|
|
29
|
+
expect(output).toContain('<');
|
|
30
|
+
expect(output).toContain('>');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should highlight self-closing tags', () => {
|
|
34
|
+
const input = '<br />';
|
|
35
|
+
const output = highlightHtml(input);
|
|
36
|
+
|
|
37
|
+
expect(output).toContain('<span class="html-tag">br</span>');
|
|
38
|
+
expect(output).toContain('/>');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should highlight attributes and values', () => {
|
|
42
|
+
const input = '<div class="foo" id=\'bar\' disabled>';
|
|
43
|
+
const output = highlightHtml(input);
|
|
44
|
+
|
|
45
|
+
expect(output).toContain('<span class="html-attr">class</span>');
|
|
46
|
+
expect(output).toContain('<span class="html-attr">id</span>');
|
|
47
|
+
expect(output).toContain('<span class="html-attr">disabled</span>');
|
|
48
|
+
|
|
49
|
+
expect(output).toContain('<span class="html-value">"foo"</span>');
|
|
50
|
+
expect(output).toContain('<span class="html-value">\'bar\'</span>');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should highlight unquoted attribute values', () => {
|
|
54
|
+
const input = '<div data-val=123>';
|
|
55
|
+
const output = highlightHtml(input);
|
|
56
|
+
|
|
57
|
+
expect(output).toContain('<span class="html-value">123</span>');
|
|
58
|
+
|
|
59
|
+
const inputEmpty = '<div data-val=>';
|
|
60
|
+
const outputEmpty = highlightHtml(inputEmpty);
|
|
61
|
+
|
|
62
|
+
expect(outputEmpty).toContain(
|
|
63
|
+
'<span class="html-attr">data-val</span>=<span class="html-value"></span>'
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should highlight string literals in text content', () => {
|
|
68
|
+
const input = 'var x = "hello" + \'world\';';
|
|
69
|
+
const output = highlightHtml(input);
|
|
70
|
+
|
|
71
|
+
expect(output).toContain('<span class="html-string">"hello"</span>');
|
|
72
|
+
expect(output).toContain('<span class="html-string">\'world\'</span>');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('should escape HTML entities in text content', () => {
|
|
76
|
+
const input = '<span>1 < 2 & 3 > 2</span>';
|
|
77
|
+
const output = highlightHtml(input);
|
|
78
|
+
|
|
79
|
+
expect(output).toContain('1 < 2 & 3 > 2');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should handle complex mixed content', () => {
|
|
83
|
+
const input = `
|
|
84
|
+
<!DOCTYPE html>
|
|
85
|
+
<!-- start -->
|
|
86
|
+
<div class="container">
|
|
87
|
+
Text with "quotes"
|
|
88
|
+
</div>
|
|
89
|
+
`.trim();
|
|
90
|
+
|
|
91
|
+
const output = highlightHtml(input);
|
|
92
|
+
|
|
93
|
+
expect(output).toContain('html-doctype');
|
|
94
|
+
expect(output).toContain('html-comment');
|
|
95
|
+
expect(output).toContain('html-tag');
|
|
96
|
+
expect(output).toContain('html-attr');
|
|
97
|
+
expect(output).toContain('html-value');
|
|
98
|
+
expect(output).toContain('html-string');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/tiptap/utils/__tests__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import * as index from '../index';
|
|
3
|
+
describe('tiptap/utils/index', () => {
|
|
4
|
+
it('should export all required modules', () => {
|
|
5
|
+
expect(index).toHaveProperty('formatHtml');
|
|
6
|
+
expect(index).toHaveProperty('highlightHtml');
|
|
7
|
+
expect(index).toHaveProperty('normalizeHtml');
|
|
8
|
+
expect(index).toHaveProperty('getExtensions');
|
|
9
|
+
expect(index).toHaveProperty('handleImageFile');
|
|
10
|
+
expect(index).toHaveProperty('validateLink');
|
|
11
|
+
expect(index).toHaveProperty('validateAutoLink');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import * as index from '../index';
|
|
4
|
+
|
|
5
|
+
describe('tiptap/utils/index', () => {
|
|
6
|
+
it('should export all required modules', () => {
|
|
7
|
+
expect(index).toHaveProperty('formatHtml');
|
|
8
|
+
expect(index).toHaveProperty('highlightHtml');
|
|
9
|
+
expect(index).toHaveProperty('normalizeHtml');
|
|
10
|
+
expect(index).toHaveProperty('getExtensions');
|
|
11
|
+
expect(index).toHaveProperty('handleImageFile');
|
|
12
|
+
expect(index).toHaveProperty('validateLink');
|
|
13
|
+
expect(index).toHaveProperty('validateAutoLink');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-html.test.d.ts","sourceRoot":"","sources":["../../../../../src/tiptap/utils/__tests__/normalize-html.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { normalizeHtml } from '../normalize-html';
|
|
3
|
+
describe('normalizeHtml', () => {
|
|
4
|
+
it('should convert HTML comments to span placeholders', () => {
|
|
5
|
+
const input = '<div><!-- my comment --></div>';
|
|
6
|
+
const output = normalizeHtml(input);
|
|
7
|
+
expect(output).toContain('<span data-type="comment" data-content=" my comment "></span>');
|
|
8
|
+
const inputEmpty = '<!---->';
|
|
9
|
+
expect(normalizeHtml(inputEmpty)).toContain('<span data-type="comment" data-content=""></span>');
|
|
10
|
+
});
|
|
11
|
+
it('should dedent script tags to avoid extra indentation', () => {
|
|
12
|
+
const input = `
|
|
13
|
+
<script>
|
|
14
|
+
console.log('test');
|
|
15
|
+
</script>
|
|
16
|
+
`;
|
|
17
|
+
const output = normalizeHtml(input);
|
|
18
|
+
expect(output).toContain("console.log('test');");
|
|
19
|
+
});
|
|
20
|
+
it('should flatten empty paragraphs containing only breaks', () => {
|
|
21
|
+
const input = '<p><br></p>';
|
|
22
|
+
const output = normalizeHtml(input);
|
|
23
|
+
expect(output).toBe('<br>');
|
|
24
|
+
});
|
|
25
|
+
it('should merge consecutive break tags if they are excessive', () => {
|
|
26
|
+
const input = 'Line<br><br>Line';
|
|
27
|
+
const output = normalizeHtml(input);
|
|
28
|
+
expect(output).toBe('Line<br>Line');
|
|
29
|
+
});
|
|
30
|
+
it('should merge consecutive break tags separated by whitespace', () => {
|
|
31
|
+
const input = 'Line<br> <br>Line';
|
|
32
|
+
const output = normalizeHtml(input);
|
|
33
|
+
expect(output).toBe('Line <br>Line');
|
|
34
|
+
});
|
|
35
|
+
it('should unwrap HR elements from paragraphs', () => {
|
|
36
|
+
const input = '<p><hr></p>';
|
|
37
|
+
const output = normalizeHtml(input);
|
|
38
|
+
expect(output).toBe('<hr>');
|
|
39
|
+
const inputWithSpace = '<p> <hr> </p>';
|
|
40
|
+
const outputWithSpace = normalizeHtml(inputWithSpace);
|
|
41
|
+
expect(outputWithSpace).toBe('<hr>');
|
|
42
|
+
});
|
|
43
|
+
it('should NOT unwrap HR from paragraphs if there is other content', () => {
|
|
44
|
+
const input = '<p>Content<hr></p>';
|
|
45
|
+
const output = normalizeHtml(input);
|
|
46
|
+
expect(output).toBe('<p>Content<hr></p>');
|
|
47
|
+
});
|
|
48
|
+
it('should flatten empty paragraphs containing whitespace and breaks', () => {
|
|
49
|
+
const input = '<p> <br> </p>';
|
|
50
|
+
const output = normalizeHtml(input);
|
|
51
|
+
expect(output).toBe('<br>');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { normalizeHtml } from '../normalize-html';
|
|
4
|
+
|
|
5
|
+
describe('normalizeHtml', () => {
|
|
6
|
+
it('should convert HTML comments to span placeholders', () => {
|
|
7
|
+
const input = '<div><!-- my comment --></div>';
|
|
8
|
+
const output = normalizeHtml(input);
|
|
9
|
+
|
|
10
|
+
expect(output).toContain(
|
|
11
|
+
'<span data-type="comment" data-content=" my comment "></span>'
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const inputEmpty = '<!---->';
|
|
15
|
+
expect(normalizeHtml(inputEmpty)).toContain(
|
|
16
|
+
'<span data-type="comment" data-content=""></span>'
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should dedent script tags to avoid extra indentation', () => {
|
|
21
|
+
const input = `
|
|
22
|
+
<script>
|
|
23
|
+
console.log('test');
|
|
24
|
+
</script>
|
|
25
|
+
`;
|
|
26
|
+
const output = normalizeHtml(input);
|
|
27
|
+
|
|
28
|
+
expect(output).toContain("console.log('test');");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should flatten empty paragraphs containing only breaks', () => {
|
|
32
|
+
const input = '<p><br></p>';
|
|
33
|
+
const output = normalizeHtml(input);
|
|
34
|
+
|
|
35
|
+
expect(output).toBe('<br>');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should merge consecutive break tags if they are excessive', () => {
|
|
39
|
+
const input = 'Line<br><br>Line';
|
|
40
|
+
const output = normalizeHtml(input);
|
|
41
|
+
|
|
42
|
+
expect(output).toBe('Line<br>Line');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should merge consecutive break tags separated by whitespace', () => {
|
|
46
|
+
const input = 'Line<br> <br>Line';
|
|
47
|
+
const output = normalizeHtml(input);
|
|
48
|
+
|
|
49
|
+
expect(output).toBe('Line <br>Line');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should unwrap HR elements from paragraphs', () => {
|
|
53
|
+
const input = '<p><hr></p>';
|
|
54
|
+
const output = normalizeHtml(input);
|
|
55
|
+
|
|
56
|
+
expect(output).toBe('<hr>');
|
|
57
|
+
|
|
58
|
+
const inputWithSpace = '<p> <hr> </p>';
|
|
59
|
+
const outputWithSpace = normalizeHtml(inputWithSpace);
|
|
60
|
+
|
|
61
|
+
expect(outputWithSpace).toBe('<hr>');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should NOT unwrap HR from paragraphs if there is other content', () => {
|
|
65
|
+
const input = '<p>Content<hr></p>';
|
|
66
|
+
const output = normalizeHtml(input);
|
|
67
|
+
|
|
68
|
+
expect(output).toBe('<p>Content<hr></p>');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should flatten empty paragraphs containing whitespace and breaks', () => {
|
|
72
|
+
const input = '<p> <br> </p>';
|
|
73
|
+
const output = normalizeHtml(input);
|
|
74
|
+
|
|
75
|
+
expect(output).toBe('<br>');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiptap-extensions.test.d.ts","sourceRoot":"","sources":["../../../../../src/tiptap/utils/__tests__/tiptap-extensions.test.ts"],"names":[],"mappings":""}
|