diff --git a/packages/core/package.json b/packages/core/package.json index 9eb69754..dd7a9f92 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,8 +51,8 @@ "@babel/runtime": "7.21.0", "@codemirror/autocomplete": "6.4.2", "@codemirror/commands": "6.2.2", - "@codemirror/language": "6.6.0", "@codemirror/language-data": "6.2.0", + "@codemirror/language": "6.6.0", "@codemirror/legacy-modes": "6.3.2", "@codemirror/lint": "6.2.0", "@codemirror/search": "6.3.0", @@ -79,19 +79,19 @@ "@styled-icons/fa-brands": "10.47.0", "@styled-icons/fluentui-system-regular": "10.47.0", "@styled-icons/heroicons-outline": "10.47.0", - "@styled-icons/material": "10.47.0", "@styled-icons/material-outlined": "10.47.0", "@styled-icons/material-rounded": "10.47.0", + "@styled-icons/material": "10.47.0", "@styled-icons/remix-editor": "10.46.0", "@styled-icons/simple-icons": "10.46.0", - "@udecode/plate": "20.6.0", "@udecode/plate-juice": "20.4.0", "@udecode/plate-serializer-md": "20.4.1", + "@udecode/plate": "20.6.0", "@uiw/codemirror-extensions-langs": "4.19.11", "@uiw/react-codemirror": "4.19.11", - "ajv": "8.12.0", "ajv-errors": "3.0.0", "ajv-keywords": "5.1.0", + "ajv": "8.12.0", "buffer": "6.0.3", "clean-stack": "5.2.0", "codemirror": "6.0.1", @@ -107,8 +107,8 @@ "fuzzy": "0.1.3", "globby": "13.1.3", "gotrue-js": "0.9.29", - "graphql": "16.6.0", "graphql-tag": "2.12.6", + "graphql": "16.6.0", "gray-matter": "4.0.3", "history": "5.3.0", "immer": "9.0.21", @@ -119,16 +119,24 @@ "jwt-decode": "3.1.2", "localforage": "1.10.0", "lodash": "4.17.21", + "mdast-util-gfm-footnote": "1.0.2", + "mdast-util-gfm-strikethrough": "1.0.3", + "mdast-util-gfm-table": "1.0.7", + "mdast-util-gfm-task-list-item": "1.0.2", + "micromark-extension-gfm-footnote": "1.1.0", + "micromark-extension-gfm-strikethrough": "1.0.5", + "micromark-extension-gfm-table": "1.0.5", + "micromark-extension-gfm-task-list-item": "1.0.4", + "micromark-util-combine-extensions": "1.0.0", "minimatch": "8.0.3", "moment": "2.29.4", "node-polyglot": "2.5.0", "ol": "7.3.0", "path-browserify": "1.0.1", "prop-types": "15.8.1", - "react": "18.2.0", "react-color": "2.19.3", - "react-dnd": "16.0.1", "react-dnd-html5-backend": "16.0.1", + "react-dnd": "16.0.1", "react-dom": "18.2.0", "react-frame-component": "5.2.6", "react-is": "18.2.0", @@ -140,29 +148,29 @@ "react-virtualized-auto-sizer": "1.0.11", "react-waypoint": "10.3.0", "react-window": "1.8.8", - "remark-gfm": "3.0.1", + "react": "18.2.0", "remark-html": "15.0.2", "remark-mdx": "2.3.0", "remark-parse": "10.0.1", "sanitize-filename": "1.6.3", "scheduler": "0.23.0", "semaphore": "1.1.0", - "slate": "0.93.0", "slate-history": "0.93.0", "slate-hyperscript": "0.77.0", "slate-react": "0.93.0", + "slate": "0.93.0", "stream-browserify": "3.0.0", "styled-components": "5.3.9", "symbol-observable": "4.0.0", "unified": "10.1.2", "unist-util-visit": "4.1.2", - "url": "0.11.0", "url-join": "5.0.0", + "url": "0.11.0", "uuid": "9.0.0", "validate-color": "2.2.4", - "vfile": "5.3.7", "vfile-message": "3.1.4", "vfile-statistics": "2.0.1", + "vfile": "5.3.7", "what-input": "5.2.12", "what-the-diff": "0.6.0", "yaml": "2.2.1" @@ -197,13 +205,13 @@ "@types/jwt-decode": "2.2.1", "@types/lodash": "4.14.191", "@types/minimatch": "5.1.2", - "@types/node": "18.15.11", "@types/node-fetch": "2.6.3", - "@types/react": "18.0.33", + "@types/node": "18.15.11", "@types/react-color": "3.0.6", "@types/react-dom": "18.0.11", "@types/react-virtualized-auto-sizer": "1.0.1", "@types/react-window": "1.8.5", + "@types/react": "18.0.33", "@types/styled-components": "5.1.26", "@types/url-join": "4.0.1", "@types/uuid": "9.0.1", @@ -222,25 +230,25 @@ "babel-plugin-transform-export-extensions": "6.22.0", "babel-plugin-transform-inline-environment-variables": "0.4.4", "cache-me-outside": "1.0.0", - "commonmark": "0.30.0", "commonmark-spec": "0.30.0", + "commonmark": "0.30.0", "cross-env": "7.0.3", "css-loader": "6.7.3", "dotenv": "16.0.3", - "eslint": "8.37.0", "eslint-import-resolver-typescript": "3.5.4", "eslint-plugin-cypress": "2.13.2", "eslint-plugin-import": "2.27.5", "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-react": "7.32.2", "eslint-plugin-unicorn": "46.0.0", + "eslint": "8.37.0", "execa": "7.1.1", "fs-extra": "11.1.1", "gitlab": "14.2.2", "http-server": "14.1.1", - "jest": "29.5.0", "jest-environment-jsdom": "29.5.0", + "jest": "29.5.0", "js-yaml": "4.1.0", "mini-css-extract-plugin": "2.7.5", "mockserver-client": "5.15.0", @@ -248,8 +256,8 @@ "ncp": "2.0.0", "node-fetch": "3.3.1", "npm-run-all": "4.1.5", - "postcss": "8.4.21", "postcss-loader": "7.2.4", + "postcss": "8.4.21", "prettier": "2.8.7", "process": "0.11.10", "react-refresh": "0.14.0", @@ -263,9 +271,9 @@ "ts-jest": "29.1.0", "tsconfig-paths-webpack-plugin": "4.0.1", "typescript": "5.0.3", - "webpack": "5.77.0", "webpack-cli": "5.0.1", - "webpack-dev-server": "4.13.2" + "webpack-dev-server": "4.13.2", + "webpack": "5.77.0" }, "peerDependencies": { "react": "^18.2.0", diff --git a/packages/core/src/widgets/markdown/plate/hooks/__tests__/useMarkdownToSlate.ispec.ts b/packages/core/src/widgets/markdown/plate/hooks/__tests__/useMarkdownToSlate.ispec.ts index 84e73da6..9644eda5 100644 --- a/packages/core/src/widgets/markdown/plate/hooks/__tests__/useMarkdownToSlate.ispec.ts +++ b/packages/core/src/widgets/markdown/plate/hooks/__tests__/useMarkdownToSlate.ispec.ts @@ -9,7 +9,10 @@ import { markdownToSlate } from '../useMarkdownToSlate'; import type { SerializationTestData } from '../../tests-util/serializationTests.util'; import type { UseMarkdownToSlateOptions } from '../useMarkdownToSlate'; -jest.unmock('remark-gfm'); +jest.unmock('mdast-util-gfm-footnote'); +jest.unmock('mdast-util-gfm-table'); +jest.unmock('mdast-util-gfm-task-list-item'); +jest.unmock('micromark-extension-gfm'); jest.unmock('remark-mdx'); jest.unmock('remark-parse'); jest.unmock('unified'); diff --git a/packages/core/src/widgets/markdown/plate/hooks/useMarkdownToSlate.ts b/packages/core/src/widgets/markdown/plate/hooks/useMarkdownToSlate.ts index a66952ba..980bffbd 100644 --- a/packages/core/src/widgets/markdown/plate/hooks/useMarkdownToSlate.ts +++ b/packages/core/src/widgets/markdown/plate/hooks/useMarkdownToSlate.ts @@ -1,11 +1,11 @@ import { ELEMENT_PARAGRAPH } from '@udecode/plate'; import { useEffect, useState } from 'react'; -import gfm from 'remark-gfm'; import mdx from 'remark-mdx'; import markdown from 'remark-parse'; import { unified } from 'unified'; import { getShortcodes } from '../../../../lib/registry'; +import gfm from '../serialization/gfm'; import toSlatePlugin from '../serialization/slate/toSlatePlugin'; import type { ShortcodeConfig } from '../../../../interface'; diff --git a/packages/core/src/widgets/markdown/plate/serialization/gfm.ts b/packages/core/src/widgets/markdown/plate/serialization/gfm.ts new file mode 100644 index 00000000..d670e63d --- /dev/null +++ b/packages/core/src/widgets/markdown/plate/serialization/gfm.ts @@ -0,0 +1,61 @@ +import { gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown } from 'mdast-util-gfm-footnote'; +import { + gfmStrikethroughFromMarkdown, + gfmStrikethroughToMarkdown, +} from 'mdast-util-gfm-strikethrough'; +import { gfmTableFromMarkdown, gfmTableToMarkdown } from 'mdast-util-gfm-table'; +import { + gfmTaskListItemFromMarkdown, + gfmTaskListItemToMarkdown, +} from 'mdast-util-gfm-task-list-item'; +import { gfmFootnote } from 'micromark-extension-gfm-footnote'; +import { gfmStrikethrough } from 'micromark-extension-gfm-strikethrough'; +import { gfmTable } from 'micromark-extension-gfm-table'; +import { gfmTaskListItem } from 'micromark-extension-gfm-task-list-item'; +import { combineExtensions } from 'micromark-util-combine-extensions'; + +import type { Root } from 'mdast'; +import type { Plugin, Processor } from 'unified'; + +function gfmFromMarkdown() { + return [ + gfmFootnoteFromMarkdown(), + gfmStrikethroughFromMarkdown, + gfmTableFromMarkdown, + gfmTaskListItemFromMarkdown, + ]; +} + +function gfmToMarkdown() { + return { + extensions: [ + gfmFootnoteToMarkdown(), + gfmStrikethroughToMarkdown, + gfmTableToMarkdown({}), + gfmTaskListItemToMarkdown, + ], + }; +} + +function gfm() { + return combineExtensions([gfmFootnote(), gfmStrikethrough({}), gfmTable, gfmTaskListItem]); +} + +/** + * Plugin to support GFM (footnotes, strikethrough, tables, tasklists). + */ +const remarkGfm: Plugin = function (this: Processor) { + const data = this.data(); + + add('micromarkExtensions', gfm()); + add('fromMarkdownExtensions', gfmFromMarkdown()); + add('toMarkdownExtensions', gfmToMarkdown()); + + function add(field: string, value: unknown) { + const list = (data[field] ? data[field] : (data[field] = [])) as unknown[]; + + list.push(value); + } +}; + +export default remarkGfm; diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/autoLinkUrls.spec.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/autoLinkUrls.spec.ts new file mode 100644 index 00000000..691094e9 --- /dev/null +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/autoLinkUrls.spec.ts @@ -0,0 +1,166 @@ +import { autoLinkToSlate } from '../autoLinkUrls'; + +import type { MdastNode } from '../ast-types'; + +describe('processShortcodeConfig', () => { + describe('autoLinkToSlate', () => { + it('converts url to anchor node', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }, + ]; + const slate: MdastNode[] = [ + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('does not convert url in shortcode node', () => { + const nodes: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: ['https://www.youtube.com/watch?v=p6h-rYSVX90'], + children: [{ text: '' }], + }, + { type: 'text', value: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }, + ]; + const slate: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: ['https://www.youtube.com/watch?v=p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('converts url with text before', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: 'Text before https://www.youtube.com/watch?v=p6h-rYSVX90' }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('converts url with text after', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: 'https://www.youtube.com/watch?v=p6h-rYSVX90 and text after' }, + ]; + const slate: MdastNode[] = [ + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + { + type: 'text', + value: ' and text after', + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('converts url with text before and after', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: 'Text before https://www.youtube.com/watch?v=p6h-rYSVX90 and text after', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + { + type: 'text', + value: ' and text after', + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('converts multiple urls', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: + 'Text before https://www.youtube.com/watch?v=p6h-rYSVX90 and https://www.youtube.com/watch?v=p6h-rYSVX90 text after', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + { + type: 'text', + value: ' and ', + }, + { + type: 'a', + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [{ text: 'https://www.youtube.com/watch?v=p6h-rYSVX90' }], + }, + { + type: 'text', + value: ' text after', + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + + it('does not convert plain text', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: 'Some text about something going on somewhere', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Some text about something going on somewhere', + }, + ]; + + expect(autoLinkToSlate(nodes)).toEqual(slate); + }); + }); +}); diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/processShortcodeConfig.spec.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/processShortcodeConfig.spec.ts index 15f2e60f..b1846294 100644 --- a/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/processShortcodeConfig.spec.ts +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/processShortcodeConfig.spec.ts @@ -1,7 +1,265 @@ -import { processShortcodeConfigToMdx } from '../processShortcodeConfig'; +import { + processShortcodeConfigToMdx, + processShortcodeConfigsToSlate, +} from '../processShortcodeConfig'; import { testShortcodeConfigs } from '../../../tests-util/serializationTests.util'; +import type { MdastNode } from '../ast-types'; + describe('processShortcodeConfig', () => { + describe('processShortcodeConfigsToSlate', () => { + it('converts shortcode', () => { + const nodes: MdastNode[] = [{ type: 'text', value: '[youtube|p6h-rYSVX90]' }]; + const slate: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts shortcode with no args', () => { + const nodes: MdastNode[] = [{ type: 'text', value: '[youtube]' }]; + const slate: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: [], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts shortcode with multiple args', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: '[youtube|p6h-rYSVX90|somethingElse|andOneMore]' }, + ]; + const slate: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90', 'somethingElse', 'andOneMore'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts shortcode with text before', () => { + const nodes: MdastNode[] = [{ type: 'text', value: 'Text before [youtube|p6h-rYSVX90]' }]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts shortcode with text after', () => { + const nodes: MdastNode[] = [{ type: 'text', value: '[youtube|p6h-rYSVX90] and text after' }]; + const slate: MdastNode[] = [ + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ' and text after', + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts shortcode with text before and after', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: 'Text before [youtube|p6h-rYSVX90] and text after' }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ' and text after', + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts multiple shortcodes', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: 'Text before [youtube|p6h-rYSVX90] and {{< twitter 917359331535966209 >}}', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ' and ', + }, + { + type: 'shortcode', + shortcode: 'twitter', + args: ['917359331535966209'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('converts multiple of the same shortcodes', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: + 'Text before [youtube|p6h-rYSVX90], [youtube|p6h-rYSVX90], {{< twitter 917359331535966209 >}} and [youtube|p6h-rYSVX90]', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ', ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ', ', + }, + { + type: 'shortcode', + shortcode: 'twitter', + args: ['917359331535966209'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ' and ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('does not convert unrecognized shortcode', () => { + const nodes: MdastNode[] = [{ type: 'text', value: '[someOtherShortcode|andstuff]' }]; + const slate: MdastNode[] = [ + { + type: 'text', + value: '[someOtherShortcode|andstuff]', + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('does not convert unrecognized shortcode surrounded by recognized shortcodes', () => { + const nodes: MdastNode[] = [ + { + type: 'text', + value: + 'Text before [youtube|p6h-rYSVX90], [someOtherShortcode|andstuff] and {{< twitter 917359331535966209 >}}', + }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Text before ', + }, + { + type: 'shortcode', + shortcode: 'youtube', + args: ['p6h-rYSVX90'], + children: [{ text: '' }], + }, + { + type: 'text', + value: ', [someOtherShortcode|andstuff] and ', + }, + { + type: 'shortcode', + shortcode: 'twitter', + args: ['917359331535966209'], + children: [{ text: '' }], + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + + it('does not convert plain text', () => { + const nodes: MdastNode[] = [ + { type: 'text', value: 'Some text about something going on somewhere' }, + ]; + const slate: MdastNode[] = [ + { + type: 'text', + value: 'Some text about something going on somewhere', + }, + ]; + + expect(processShortcodeConfigsToSlate(testShortcodeConfigs, nodes)).toEqual(slate); + }); + }); + describe('processShortcodeConfigToMdx', () => { it('converts to mdx', () => { const markdown = '[youtube|p6h-rYSVX90]'; @@ -25,21 +283,21 @@ describe('processShortcodeConfig', () => { expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('shortcode with text before', () => { + it('converts shortcode with text before', () => { const markdown = 'Text before [youtube|p6h-rYSVX90]'; const mdx = 'Text before '; expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('shortcode with text after', () => { + it('converts shortcode with text after', () => { const markdown = '[youtube|p6h-rYSVX90] and text after'; const mdx = ' and text after'; expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('shortcode with text before and after', () => { + it('converts shortcode with text before and after', () => { const markdown = 'Text before [youtube|p6h-rYSVX90] and text after'; const mdx = 'Text before and text after'; @@ -47,7 +305,7 @@ describe('processShortcodeConfig', () => { expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('multiple shortcodes', () => { + it('converts multiple shortcodes', () => { const markdown = 'Text before [youtube|p6h-rYSVX90] and {{< twitter 917359331535966209 >}}'; const mdx = 'Text before and '; @@ -55,7 +313,7 @@ describe('processShortcodeConfig', () => { expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('multiple of the same shortcodes', () => { + it('converts multiple of the same shortcodes', () => { const markdown = 'Text before [youtube|p6h-rYSVX90], [youtube|p6h-rYSVX90], {{< twitter 917359331535966209 >}} and [youtube|p6h-rYSVX90]'; const mdx = @@ -64,14 +322,14 @@ describe('processShortcodeConfig', () => { expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('unrecognized shortcode', () => { + it('does not convert unrecognized shortcode', () => { const markdown = '[someOtherShortcode|andstuff]'; const mdx = '[someOtherShortcode|andstuff]'; expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('unrecognized shortcode surrounded by recognized shortcodes', () => { + it('does not convert unrecognized shortcode surrounded by recognized shortcodes', () => { const markdown = 'Text before [youtube|p6h-rYSVX90], [someOtherShortcode|andstuff] and {{< twitter 917359331535966209 >}}'; const mdx = @@ -80,7 +338,7 @@ describe('processShortcodeConfig', () => { expect(processShortcodeConfigToMdx(testShortcodeConfigs, markdown)).toBe(mdx); }); - it('plain text', () => { + it('does not convert plain text', () => { const markdown = 'Some text about something going on somewhere'; const mdx = 'Some text about something going on somewhere'; diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/toSlatePlugin.spec.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/toSlatePlugin.spec.ts deleted file mode 100644 index 8d0a31e9..00000000 --- a/packages/core/src/widgets/markdown/plate/serialization/slate/__tests__/toSlatePlugin.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - deserializationOnlyTestData, - runSerializationTests, - testShortcodeConfigs as shortcodeConfigs, -} from '../../../tests-util/serializationTests.util'; -import { slateCompiler } from '../toSlatePlugin'; - -import type { SerializationTestData } from '../../../tests-util/serializationTests.util'; -import type { MdastNode } from '../ast-types'; - -async function expectNodes( - mdast: MdastNode, - useMdx: boolean, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - children: any[], -) { - const compiler = slateCompiler({ useMdx, shortcodeConfigs }); - - expect(compiler(mdast)).toEqual(children); -} - -function testRunner(key: string, mode: 'markdown' | 'mdx' | 'both', data: SerializationTestData) { - it(`deserializes ${key}`, async () => { - await expectNodes(data.mdast, mode === 'mdx', data.slate); - }); -} - -describe('markdownToSlate', () => { - runSerializationTests(testRunner); - runSerializationTests(testRunner, deserializationOnlyTestData); -}); diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/autoLinkUrls.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/autoLinkUrls.ts new file mode 100644 index 00000000..061ca35a --- /dev/null +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/autoLinkUrls.ts @@ -0,0 +1,45 @@ +/* eslint-disable import/prefer-default-export */ + +import { isNotEmpty } from '@staticcms/core/lib/util/string.util'; +import { NodeTypes } from './ast-types'; + +import type { BaseMdastNode, MdastNode } from './ast-types'; + +export function autoLinkToSlate(nodes: BaseMdastNode[]) { + const output: MdastNode[] = []; + + for (const node of nodes) { + if (node.type === 'text' && node.value) { + const regex = + /([\w\W]*?)((?:http(?:s)?:\/\/.)?(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_+.~#?&//=]*))([\w\W]*)/g; + let matches: RegExpExecArray | null; + let rest = node.value; + while (isNotEmpty(rest) && (matches = regex.exec(rest)) !== null && matches.length === 4) { + if (isNotEmpty(matches[1])) { + output.push({ + type: 'text', + value: matches[1], + }); + } + output.push({ + type: NodeTypes.link, + url: matches[2], + children: [{ text: matches[2] }], + }); + rest = matches[3]; + regex.lastIndex = 0; + } + if (isNotEmpty(rest)) { + output.push({ + type: 'text', + value: rest, + }); + } + continue; + } + + output.push(node); + } + + return output; +} diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/deserializeMarkdown.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/deserializeMarkdown.ts index dff616e6..f0a9570e 100644 --- a/packages/core/src/widgets/markdown/plate/serialization/slate/deserializeMarkdown.ts +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/deserializeMarkdown.ts @@ -2,7 +2,8 @@ import { ELEMENT_PARAGRAPH } from '@udecode/plate'; import { LIST_TYPES, MarkNodeTypes, NodeTypes } from './ast-types'; -import { processShortcodeConfigToSlate } from './processShortcodeConfig'; +import { autoLinkToSlate } from './autoLinkUrls'; +import { processShortcodeConfigsToSlate } from './processShortcodeConfig'; import type { ShortcodeConfig } from '@staticcms/core/interface'; import type { MdBlockElement } from '@staticcms/markdown'; @@ -350,11 +351,7 @@ export default function deserializeMarkdown(node: MdastNode, options: Options) { return { text: '' }; } - let nodes: MdastNode[] = [node]; - - for (const shortcode in shortcodeConfigs) { - nodes = processShortcodeConfigToSlate(shortcode, shortcodeConfigs[shortcode], nodes); - } + const nodes = autoLinkToSlate(processShortcodeConfigsToSlate(shortcodeConfigs, [node])); return nodes.map(node => (node.type === 'text' ? { text: node.value ?? '' } : node)); diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/processShortcodeConfig.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/processShortcodeConfig.ts index 686571ee..fa327359 100644 --- a/packages/core/src/widgets/markdown/plate/serialization/slate/processShortcodeConfig.ts +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/processShortcodeConfig.ts @@ -19,7 +19,7 @@ function createShortcodeRegex(name: string, config: ShortcodeConfig) { )}?([\\w\\W]*?)${cleanRegex(config.closeTag)}`; } -export function processShortcodeConfigToSlate( +function processShortcodeConfigToSlate( name: string, config: ShortcodeConfig, nodes: BaseMdastNode[], @@ -68,6 +68,19 @@ export function processShortcodeConfigToSlate( return output; } +export function processShortcodeConfigsToSlate( + configs: Record, + nodes: BaseMdastNode[], +) { + let finalNodes: MdastNode[] = nodes; + + for (const shortcode in configs) { + finalNodes = processShortcodeConfigToSlate(shortcode, configs[shortcode], finalNodes); + } + + return finalNodes; +} + export function processShortcodeConfigToMdx( configs: Record, markdown: string, diff --git a/packages/core/src/widgets/markdown/plate/tests-util/serializationTests.util.tsx b/packages/core/src/widgets/markdown/plate/tests-util/serializationTests.util.tsx index 8041074e..f6c916ff 100644 --- a/packages/core/src/widgets/markdown/plate/tests-util/serializationTests.util.tsx +++ b/packages/core/src/widgets/markdown/plate/tests-util/serializationTests.util.tsx @@ -25,7 +25,6 @@ import { ELEMENT_SHORTCODE } from '../plateTypes'; import type { ShortcodeConfig } from '@staticcms/core/interface'; import type { MdValue } from '../plateTypes'; -import type { MdastNode } from '../serialization'; export const testShortcodeConfigs: Record = { twitter: { @@ -46,7 +45,7 @@ export const testShortcodeConfigs: Record = { export interface SerializationTestData { markdown: string; - mdast: MdastNode; + // mdast: MdastNode; slate: MdValue; } @@ -63,32 +62,6 @@ const serializationTestData: SerializationTests = { both: { paragraph: { markdown: 'A line of text', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'A line of text', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -104,32 +77,6 @@ const serializationTestData: SerializationTests = { 'paragraph with line break': { markdown: `A line of text With another in the same paragraph`, - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'A line of text\nWith another in the same paragraph', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 35, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 35, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 35, offset: 49 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -146,49 +93,6 @@ With another in the same paragraph`, markdown: `A line of text And a completely new paragraph`, - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'A line of text', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'And a completely new paragraph', - position: { - start: { line: 3, column: 1, offset: 16 }, - end: { line: 3, column: 31, offset: 46 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 16 }, - end: { line: 3, column: 31, offset: 46 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 31, offset: 46 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -215,33 +119,6 @@ And a completely new paragraph`, both: { 'header 1': { markdown: '# Header One', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 1, - children: [ - { - type: 'text', - value: 'Header One', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, slate: [ { type: ELEMENT_H1, @@ -256,33 +133,6 @@ And a completely new paragraph`, 'header 2': { markdown: '## Header Two', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'Header Two', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, slate: [ { type: ELEMENT_H2, @@ -297,33 +147,6 @@ And a completely new paragraph`, 'header 3': { markdown: '### Header Three', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 3, - children: [ - { - type: 'text', - value: 'Header Three', - position: { - start: { line: 1, column: 5, offset: 4 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, slate: [ { type: ELEMENT_H3, @@ -338,33 +161,6 @@ And a completely new paragraph`, 'header 4': { markdown: '#### Header Four', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 4, - children: [ - { - type: 'text', - value: 'Header Four', - position: { - start: { line: 1, column: 6, offset: 5 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, slate: [ { type: ELEMENT_H4, @@ -379,33 +175,6 @@ And a completely new paragraph`, 'header 5': { markdown: '##### Header Five', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 5, - children: [ - { - type: 'text', - value: 'Header Five', - position: { - start: { line: 1, column: 7, offset: 6 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, slate: [ { type: ELEMENT_H5, @@ -420,33 +189,6 @@ And a completely new paragraph`, 'header 6': { markdown: '###### Header Six', - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 6, - children: [ - { - type: 'text', - value: 'Header Six', - position: { - start: { line: 1, column: 8, offset: 7 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, slate: [ { type: ELEMENT_H6, @@ -462,33 +204,6 @@ And a completely new paragraph`, 'Multiline Header': { markdown: `# Line One\ Line Two`, - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 1, - children: [ - { - type: 'text', - value: 'Line One Line Two', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 13, offset: 12 }, - }, - }, slate: [ { type: ELEMENT_H1, @@ -507,41 +222,6 @@ And a completely new paragraph`, both: { blockquote: { markdown: '> I am a block quote', - mdast: { - type: 'root', - children: [ - { - type: 'blockquote', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'I am a block quote', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, slate: [ { type: ELEMENT_BLOCKQUOTE, @@ -556,41 +236,6 @@ And a completely new paragraph`, 'multiline blockquote': { markdown: '> I am a block quote\n> And another line', - mdast: { - type: 'root', - children: [ - { - type: 'blockquote', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'I am a block quote\nAnd another line', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 2, column: 19, offset: 39 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 2, column: 19, offset: 39 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 19, offset: 39 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 19, offset: 39 }, - }, - }, slate: [ { type: ELEMENT_BLOCKQUOTE, @@ -605,67 +250,6 @@ And a completely new paragraph`, 'nested blockquote': { markdown: '> I am a block quote\n> > And another line', - mdast: { - type: 'root', - children: [ - { - type: 'blockquote', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'I am a block quote', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - { - type: 'blockquote', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'And another line', - position: { - start: { line: 2, column: 5, offset: 25 }, - end: { line: 2, column: 21, offset: 41 }, - }, - }, - ], - position: { - start: { line: 2, column: 5, offset: 25 }, - end: { line: 2, column: 21, offset: 41 }, - }, - }, - ], - position: { - start: { line: 2, column: 3, offset: 23 }, - end: { line: 2, column: 21, offset: 41 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 21, offset: 41 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 2, column: 21, offset: 41 }, - }, - }, slate: [ { type: ELEMENT_BLOCKQUOTE, @@ -692,33 +276,6 @@ And a completely new paragraph`, both: { 'inline code': { markdown: "`Colored Text`", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'inlineCode', - value: - "Colored Text", - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 79, offset: 78 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 79, offset: 78 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 79, offset: 78 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -739,25 +296,6 @@ And a completely new paragraph`, 'code block': { markdown: "```\nColored Text\n```", - mdast: { - type: 'root', - children: [ - { - type: 'code', - lang: null, - meta: null, - value: "Colored Text", - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 4, offset: 84 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 4, offset: 84 }, - }, - }, slate: [ { type: ELEMENT_CODE_BLOCK, @@ -775,25 +313,6 @@ And a completely new paragraph`, 'code block with language': { markdown: "```javascript\nColored Text\n```", - mdast: { - type: 'root', - children: [ - { - type: 'code', - lang: 'javascript', - meta: null, - value: "Colored Text", - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 4, offset: 94 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 4, offset: 94 }, - }, - }, slate: [ { type: ELEMENT_CODE_BLOCK, @@ -814,34 +333,6 @@ And a completely new paragraph`, both: { image: { markdown: '![Alt Text](https://example.com/picture.png)', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'image', - title: null, - url: 'https://example.com/picture.png', - alt: 'Alt Text', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -863,34 +354,6 @@ And a completely new paragraph`, 'image without alt text': { markdown: '![](https://example.com/picture.png)', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'image', - title: null, - url: 'https://example.com/picture.png', - alt: '', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -916,43 +379,6 @@ And a completely new paragraph`, both: { links: { markdown: '[Link Text](https://example.com/)', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'link', - title: null, - url: 'https://example.com/', - children: [ - { - type: 'text', - value: 'Link Text', - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 11, offset: 10 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -979,111 +405,6 @@ And a completely new paragraph`, markdown: `- List Item 1 - List Item 2 - List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - ], - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 14 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 3, offset: 30 }, - end: { line: 3, column: 14, offset: 41 }, - }, - }, - ], - position: { - start: { line: 3, column: 3, offset: 30 }, - end: { line: 3, column: 14, offset: 41 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 28 }, - end: { line: 3, column: 14, offset: 41 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 14, offset: 41 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 14, offset: 41 }, - }, - }, slate: [ { type: ELEMENT_UL, @@ -1139,123 +460,6 @@ And a completely new paragraph`, markdown: `- List Item 1 - List Item 2 - List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - ], - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 5, offset: 32 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 3, column: 5, offset: 32 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 3, column: 3, offset: 30 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 3, column: 3, offset: 30 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 14 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 16, offset: 43 }, - }, - }, slate: [ { type: ELEMENT_UL, @@ -1316,123 +520,6 @@ And a completely new paragraph`, markdown: `- [ ] List Item 1 - [x] List Item 2 - [x] List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: false, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 7, offset: 6 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 7, offset: 6 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: true, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 7, offset: 24 }, - end: { line: 2, column: 18, offset: 35 }, - }, - }, - ], - position: { - start: { line: 2, column: 7, offset: 24 }, - end: { line: 2, column: 18, offset: 35 }, - }, - }, - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: true, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 9, offset: 44 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 3, column: 9, offset: 44 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 3, column: 3, offset: 38 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 3, column: 3, offset: 38 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 18 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 20, offset: 55 }, - }, - }, slate: [ { type: ELEMENT_UL, @@ -1493,111 +580,6 @@ And a completely new paragraph`, markdown: `1. List Item 1 1. List Item 2 1. List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 4, offset: 18 }, - end: { line: 2, column: 15, offset: 29 }, - }, - }, - ], - position: { - start: { line: 2, column: 4, offset: 18 }, - end: { line: 2, column: 15, offset: 29 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 15 }, - end: { line: 2, column: 15, offset: 29 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 4, offset: 33 }, - end: { line: 3, column: 15, offset: 44 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 33 }, - end: { line: 3, column: 15, offset: 44 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 30 }, - end: { line: 3, column: 15, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 15, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 15, offset: 44 }, - }, - }, slate: [ { type: ELEMENT_OL, @@ -1653,123 +635,6 @@ And a completely new paragraph`, markdown: `1. List Item 1 1. List Item 2 1. List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 4, offset: 18 }, - end: { line: 2, column: 15, offset: 29 }, - }, - }, - ], - position: { - start: { line: 2, column: 4, offset: 18 }, - end: { line: 2, column: 15, offset: 29 }, - }, - }, - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 7, offset: 36 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 3, column: 7, offset: 36 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 33 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 33 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 15 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 18, offset: 47 }, - }, - }, slate: [ { type: ELEMENT_OL, @@ -1830,123 +695,6 @@ And a completely new paragraph`, markdown: `1. [x] List Item 1 1. [ ] List Item 2 1. [ ] List Item 3`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: true, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 8, offset: 7 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 8, offset: 7 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: false, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 8, offset: 26 }, - end: { line: 2, column: 19, offset: 37 }, - }, - }, - ], - position: { - start: { line: 2, column: 8, offset: 26 }, - end: { line: 2, column: 19, offset: 37 }, - }, - }, - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: false, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 11, offset: 48 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 3, column: 11, offset: 48 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 41 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 41 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 19 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 3, column: 22, offset: 59 }, - }, - }, slate: [ { type: ELEMENT_OL, @@ -2008,151 +756,6 @@ And a completely new paragraph`, - List Item 2 1. [x] List Item 3 1. [ ] List Item 4`, - mdast: { - type: 'root', - children: [ - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 1', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 2', - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - ], - position: { - start: { line: 2, column: 3, offset: 16 }, - end: { line: 2, column: 14, offset: 27 }, - }, - }, - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: true, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 3', - position: { - start: { line: 3, column: 11, offset: 38 }, - end: { line: 3, column: 22, offset: 49 }, - }, - }, - ], - position: { - start: { line: 3, column: 11, offset: 38 }, - end: { line: 3, column: 22, offset: 49 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 31 }, - end: { line: 3, column: 22, offset: 49 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: false, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'List Item 4', - position: { - start: { line: 4, column: 11, offset: 60 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 4, column: 11, offset: 60 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 4, column: 4, offset: 53 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 3, column: 4, offset: 31 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 2, column: 1, offset: 14 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 4, column: 22, offset: 71 }, - }, - }, slate: [ { type: ELEMENT_UL, @@ -2229,41 +832,6 @@ And a completely new paragraph`, both: { 'italic (using _)': { markdown: '_Italic_', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Italic', - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 8, offset: 7 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2283,41 +851,6 @@ And a completely new paragraph`, both: { 'bold (using **)': { markdown: '**Bold**', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'Bold', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 7, offset: 6 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2337,41 +870,6 @@ And a completely new paragraph`, both: { strikethrough: { markdown: '~~Strikethrough~~', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'delete', - children: [ - { - type: 'text', - value: 'Strikethrough', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 16, offset: 15 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2391,23 +889,6 @@ And a completely new paragraph`, markdown: { align: { markdown: "

Align Center

", - mdast: { - type: 'root', - children: [ - { - type: 'html', - value: "

Align Center

", - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 52, offset: 51 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 52, offset: 51 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2424,52 +905,6 @@ And a completely new paragraph`, mdx: { 'align left': { markdown: "

Align Left

", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'p', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ textAlign: 'left' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Align Left', - position: { - start: { line: 1, column: 34, offset: 33 }, - end: { line: 1, column: 44, offset: 43 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 48, offset: 47 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 48, offset: 47 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 48, offset: 47 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2485,52 +920,6 @@ And a completely new paragraph`, 'align center': { markdown: "

Align Center

", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'p', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ textAlign: 'center' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Align Center', - position: { - start: { line: 1, column: 36, offset: 35 }, - end: { line: 1, column: 48, offset: 47 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 52, offset: 51 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 52, offset: 51 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 52, offset: 51 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2546,52 +935,6 @@ And a completely new paragraph`, 'align right': { markdown: "

Align Right

", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'p', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ textAlign: 'right' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Align Right', - position: { - start: { line: 1, column: 35, offset: 34 }, - end: { line: 1, column: 46, offset: 45 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 50, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 50, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 50, offset: 49 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2611,43 +954,6 @@ And a completely new paragraph`, mdx: { 'subscript tag': { markdown: 'Subscript', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'sub', - attributes: [], - children: [ - { - type: 'text', - value: 'Subscript', - position: { - start: { line: 1, column: 6, offset: 5 }, - end: { line: 1, column: 15, offset: 14 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2667,43 +973,6 @@ And a completely new paragraph`, mdx: { 'superscript tag': { markdown: 'Superscript', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'sup', - attributes: [], - children: [ - { - type: 'text', - value: 'Superscript', - position: { - start: { line: 1, column: 6, offset: 5 }, - end: { line: 1, column: 17, offset: 16 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 23, offset: 22 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 23, offset: 22 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 23, offset: 22 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2723,43 +992,6 @@ And a completely new paragraph`, mdx: { 'underline tag': { markdown: 'Underlined', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'u', - attributes: [], - children: [ - { - type: 'text', - value: 'Underlined', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 14, offset: 13 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 18, offset: 17 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2779,52 +1011,6 @@ And a completely new paragraph`, mdx: { 'color and background color from style attribute of font tag': { markdown: "Colored Text", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'font', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ color: 'red', backgroundColor: 'black' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Colored Text', - position: { - start: { line: 1, column: 58, offset: 57 }, - end: { line: 1, column: 70, offset: 69 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 77, offset: 76 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 77, offset: 76 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 77, offset: 76 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2845,32 +1031,6 @@ And a completely new paragraph`, markdown: { shortcode: { markdown: '[youtube|p6h-rYSVX90]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube|p6h-rYSVX90]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2890,34 +1050,29 @@ And a completely new paragraph`, ], }, + 'shortcode with url': { + markdown: '[youtube|https://www.youtube.com/watch?v=p6h-rYSVX90]', + slate: [ + { + type: ELEMENT_PARAGRAPH, + children: [ + { + type: ELEMENT_SHORTCODE, + shortcode: 'youtube', + args: ['https://www.youtube.com/watch?v=p6h-rYSVX90'], + children: [ + { + text: '', + }, + ], + }, + ], + }, + ], + }, + 'shortcode with no args': { markdown: '[youtube]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 10, offset: 9 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 10, offset: 9 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 10, offset: 9 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2939,32 +1094,6 @@ And a completely new paragraph`, 'shortcode with multiple args': { markdown: '[youtube|p6h-rYSVX90|somethingElse|andOneMore]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube|p6h-rYSVX90|somethingElse|andOneMore]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 47, offset: 46 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 47, offset: 46 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 47, offset: 46 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -2986,32 +1115,6 @@ And a completely new paragraph`, 'shortcode with text before': { markdown: 'Text before [youtube|p6h-rYSVX90]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Text before [youtube|p6h-rYSVX90]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 34, offset: 33 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3036,32 +1139,6 @@ And a completely new paragraph`, 'shortcode with text after': { markdown: '[youtube|p6h-rYSVX90] and text after', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube|p6h-rYSVX90] and text after', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 37, offset: 36 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3086,32 +1163,6 @@ And a completely new paragraph`, 'shortcode with text before and after': { markdown: 'Text before [youtube|p6h-rYSVX90] and text after', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Text before [youtube|p6h-rYSVX90] and text after', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 49, offset: 48 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 49, offset: 48 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 49, offset: 48 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3139,32 +1190,6 @@ And a completely new paragraph`, 'multiple shortcodes': { markdown: 'Text before [youtube|p6h-rYSVX90] and {{< twitter 917359331535966209 >}}', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Text before [youtube|p6h-rYSVX90] and {{< twitter 917359331535966209 >}}', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 73, offset: 72 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 73, offset: 72 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 73, offset: 72 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3203,33 +1228,6 @@ And a completely new paragraph`, 'multiple of the same shortcodes': { markdown: 'Text before [youtube|p6h-rYSVX90], [youtube|p6h-rYSVX90], {{< twitter 917359331535966209 >}} and [youtube|p6h-rYSVX90]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: - 'Text before [youtube|p6h-rYSVX90], [youtube|p6h-rYSVX90], {{< twitter 917359331535966209 >}} and [youtube|p6h-rYSVX90]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 119, offset: 118 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 119, offset: 118 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 119, offset: 118 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3293,32 +1291,6 @@ And a completely new paragraph`, 'unrecognized shortcode': { markdown: '[someOtherShortcode|andstuff]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[someOtherShortcode|andstuff]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 30, offset: 29 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 30, offset: 29 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 30, offset: 29 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3334,33 +1306,6 @@ And a completely new paragraph`, 'unrecognized shortcode surrounded by recognized shortcodes': { markdown: 'Text before [youtube|p6h-rYSVX90], [someOtherShortcode|andstuff] and {{< twitter 917359331535966209 >}}', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: - 'Text before [youtube|p6h-rYSVX90], [someOtherShortcode|andstuff] and {{< twitter 917359331535966209 >}}', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 104, offset: 103 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 104, offset: 103 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 104, offset: 103 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3398,32 +1343,6 @@ And a completely new paragraph`, 'plain text': { markdown: 'Some text about something going on somewhere', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Some text about something going on somewhere', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 45, offset: 44 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3440,32 +1359,6 @@ And a completely new paragraph`, mdx: { shortcode: { markdown: '[youtube|p6h-rYSVX90]', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube|p6h-rYSVX90]', - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -3488,197 +1381,6 @@ And a completely new paragraph`, |Bob|25| |Billy|30| |Sam|29|`, - mdast: { - type: 'root', - children: [ - { - type: 'table', - align: [null, null], - children: [ - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Name', - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 6, offset: 5 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 7, offset: 6 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Age', - position: { - start: { line: 1, column: 7, offset: 6 }, - end: { line: 1, column: 10, offset: 9 }, - }, - }, - ], - position: { - start: { line: 1, column: 7, offset: 6 }, - end: { line: 1, column: 11, offset: 10 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 11, offset: 10 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Bob', - position: { - start: { line: 3, column: 2, offset: 22 }, - end: { line: 3, column: 5, offset: 25 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 21 }, - end: { line: 3, column: 6, offset: 26 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: '25', - position: { - start: { line: 3, column: 6, offset: 26 }, - end: { line: 3, column: 8, offset: 28 }, - }, - }, - ], - position: { - start: { line: 3, column: 6, offset: 26 }, - end: { line: 3, column: 9, offset: 29 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 21 }, - end: { line: 3, column: 9, offset: 29 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Billy', - position: { - start: { line: 4, column: 2, offset: 31 }, - end: { line: 4, column: 7, offset: 36 }, - }, - }, - ], - position: { - start: { line: 4, column: 1, offset: 30 }, - end: { line: 4, column: 8, offset: 37 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: '30', - position: { - start: { line: 4, column: 8, offset: 37 }, - end: { line: 4, column: 10, offset: 39 }, - }, - }, - ], - position: { - start: { line: 4, column: 8, offset: 37 }, - end: { line: 4, column: 11, offset: 40 }, - }, - }, - ], - position: { - start: { line: 4, column: 1, offset: 30 }, - end: { line: 4, column: 11, offset: 40 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Sam', - position: { - start: { line: 5, column: 2, offset: 42 }, - end: { line: 5, column: 5, offset: 45 }, - }, - }, - ], - position: { - start: { line: 5, column: 1, offset: 41 }, - end: { line: 5, column: 6, offset: 46 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: '29', - position: { - start: { line: 5, column: 6, offset: 46 }, - end: { line: 5, column: 8, offset: 48 }, - }, - }, - ], - position: { - start: { line: 5, column: 6, offset: 46 }, - end: { line: 5, column: 9, offset: 49 }, - }, - }, - ], - position: { - start: { line: 5, column: 1, offset: 41 }, - end: { line: 5, column: 9, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 5, column: 9, offset: 49 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 5, column: 9, offset: 49 }, - }, - }, slate: [ { type: ELEMENT_TABLE, @@ -3892,1858 +1594,6 @@ Text ahead [youtube|p6h-rYSVX90] and behind and another {{< twitter 917359331535 > - Supports wrappers > 1. [x] React > 1. [ ] More coming soon`, - mdast: { - type: 'root', - children: [ - { - type: 'heading', - depth: 1, - children: [ - { - type: 'text', - value: 'The post is number 1', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 23, offset: 22 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 23, offset: 22 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'image', - title: null, - url: 'https://raw.githubusercontent.com/StaticJsCMS/static-cms/main/static-cms-logo.png', - alt: 'Static CMS', - position: { - start: { line: 3, column: 1, offset: 24 }, - end: { line: 3, column: 97, offset: 120 }, - }, - }, - ], - position: { - start: { line: 3, column: 1, offset: 24 }, - end: { line: 3, column: 97, offset: 120 }, - }, - }, - { - type: 'heading', - depth: 1, - children: [ - { - type: 'text', - value: 'Awesome Editor!', - position: { - start: { line: 5, column: 3, offset: 124 }, - end: { line: 5, column: 18, offset: 139 }, - }, - }, - ], - position: { - start: { line: 5, column: 1, offset: 122 }, - end: { line: 5, column: 18, offset: 139 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'It was ', - position: { - start: { line: 7, column: 1, offset: 141 }, - end: { line: 7, column: 8, offset: 148 }, - }, - }, - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'released as open source in 2022', - position: { - start: { line: 7, column: 9, offset: 149 }, - end: { line: 7, column: 40, offset: 180 }, - }, - }, - ], - position: { - start: { line: 7, column: 8, offset: 148 }, - end: { line: 7, column: 41, offset: 181 }, - }, - }, - { - type: 'text', - value: ' and is ', - position: { - start: { line: 7, column: 41, offset: 181 }, - end: { line: 7, column: 49, offset: 189 }, - }, - }, - { - type: 'emphasis', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'continually', - position: { - start: { line: 7, column: 52, offset: 192 }, - end: { line: 7, column: 63, offset: 203 }, - }, - }, - ], - position: { - start: { line: 7, column: 50, offset: 190 }, - end: { line: 7, column: 65, offset: 205 }, - }, - }, - ], - position: { - start: { line: 7, column: 49, offset: 189 }, - end: { line: 7, column: 66, offset: 206 }, - }, - }, - { - type: 'text', - value: ' evolving to be the ', - position: { - start: { line: 7, column: 66, offset: 206 }, - end: { line: 7, column: 86, offset: 226 }, - }, - }, - { - type: 'strong', - children: [ - { - type: 'text', - value: 'best editor experience', - position: { - start: { line: 7, column: 88, offset: 228 }, - end: { line: 7, column: 110, offset: 250 }, - }, - }, - ], - position: { - start: { line: 7, column: 86, offset: 226 }, - end: { line: 7, column: 112, offset: 252 }, - }, - }, - { - type: 'text', - value: ' available for static site generators.', - position: { - start: { line: 7, column: 112, offset: 252 }, - end: { line: 7, column: 150, offset: 290 }, - }, - }, - ], - position: { - start: { line: 7, column: 1, offset: 141 }, - end: { line: 7, column: 150, offset: 290 }, - }, - }, - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'MDX', - position: { - start: { line: 9, column: 4, offset: 295 }, - end: { line: 9, column: 7, offset: 298 }, - }, - }, - ], - position: { - start: { line: 9, column: 1, offset: 292 }, - end: { line: 9, column: 7, offset: 298 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'The output out this widget is ', - position: { - start: { line: 11, column: 1, offset: 300 }, - end: { line: 11, column: 31, offset: 330 }, - }, - }, - { - type: 'inlineCode', - value: 'mdx', - position: { - start: { line: 11, column: 31, offset: 330 }, - end: { line: 11, column: 36, offset: 335 }, - }, - }, - { - type: 'text', - value: ', a mixture of ', - position: { - start: { line: 11, column: 36, offset: 335 }, - end: { line: 11, column: 51, offset: 350 }, - }, - }, - { - type: 'inlineCode', - value: 'markdown', - position: { - start: { line: 11, column: 51, offset: 350 }, - end: { line: 11, column: 61, offset: 360 }, - }, - }, - { - type: 'text', - value: ' and ', - position: { - start: { line: 11, column: 61, offset: 360 }, - end: { line: 11, column: 66, offset: 365 }, - }, - }, - { - type: 'inlineCode', - value: 'javascript components', - position: { - start: { line: 11, column: 66, offset: 365 }, - end: { line: 11, column: 89, offset: 388 }, - }, - }, - { - type: 'text', - value: '. See ', - position: { - start: { line: 11, column: 89, offset: 388 }, - end: { line: 11, column: 95, offset: 394 }, - }, - }, - { - type: 'link', - title: null, - url: 'https://mdxjs.com/docs/', - children: [ - { - type: 'text', - value: 'MDX documentation', - position: { - start: { line: 11, column: 96, offset: 395 }, - end: { line: 11, column: 113, offset: 412 }, - }, - }, - ], - position: { - start: { line: 11, column: 95, offset: 394 }, - end: { line: 11, column: 139, offset: 438 }, - }, - }, - { - type: 'text', - value: '.', - position: { - start: { line: 11, column: 139, offset: 438 }, - end: { line: 11, column: 140, offset: 439 }, - }, - }, - ], - position: { - start: { line: 11, column: 1, offset: 300 }, - end: { line: 11, column: 140, offset: 439 }, - }, - }, - { - type: 'code', - lang: 'yaml', - meta: null, - value: 'name: body\nlabel: Blog post content\nwidget: markdown', - position: { - start: { line: 13, column: 1, offset: 441 }, - end: { line: 17, column: 4, offset: 505 }, - }, - }, - { - type: 'code', - lang: 'js', - meta: null, - value: "name: 'body',\nlabel: 'Blog post content',\nwidget: 'markdown',", - position: { - start: { line: 19, column: 1, offset: 507 }, - end: { line: 23, column: 4, offset: 578 }, - }, - }, - { - type: 'blockquote', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: - 'See the table below for default options\nMore API information can be found in the document', - position: { - start: { line: 25, column: 3, offset: 582 }, - end: { line: 26, column: 52, offset: 673 }, - }, - }, - ], - position: { - start: { line: 25, column: 3, offset: 582 }, - end: { line: 26, column: 52, offset: 673 }, - }, - }, - ], - position: { - start: { line: 25, column: 1, offset: 580 }, - end: { line: 26, column: 52, offset: 673 }, - }, - }, - { - type: 'table', - align: [null, null, null, null], - children: [ - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Name', - position: { - start: { line: 28, column: 2, offset: 676 }, - end: { line: 28, column: 6, offset: 680 }, - }, - }, - ], - position: { - start: { line: 28, column: 1, offset: 675 }, - end: { line: 28, column: 7, offset: 681 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Type', - position: { - start: { line: 28, column: 7, offset: 681 }, - end: { line: 28, column: 11, offset: 685 }, - }, - }, - ], - position: { - start: { line: 28, column: 7, offset: 681 }, - end: { line: 28, column: 12, offset: 686 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Default', - position: { - start: { line: 28, column: 12, offset: 686 }, - end: { line: 28, column: 19, offset: 693 }, - }, - }, - ], - position: { - start: { line: 28, column: 12, offset: 686 }, - end: { line: 28, column: 20, offset: 694 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Description', - position: { - start: { line: 28, column: 20, offset: 694 }, - end: { line: 28, column: 31, offset: 705 }, - }, - }, - ], - position: { - start: { line: 28, column: 20, offset: 694 }, - end: { line: 28, column: 32, offset: 706 }, - }, - }, - ], - position: { - start: { line: 28, column: 1, offset: 675 }, - end: { line: 28, column: 32, offset: 706 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'default', - position: { - start: { line: 30, column: 2, offset: 726 }, - end: { line: 30, column: 9, offset: 733 }, - }, - }, - ], - position: { - start: { line: 30, column: 1, offset: 725 }, - end: { line: 30, column: 10, offset: 734 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'string', - position: { - start: { line: 30, column: 10, offset: 734 }, - end: { line: 30, column: 16, offset: 740 }, - }, - }, - ], - position: { - start: { line: 30, column: 10, offset: 734 }, - end: { line: 30, column: 17, offset: 741 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'inlineCode', - value: "''", - position: { - start: { line: 30, column: 17, offset: 741 }, - end: { line: 30, column: 21, offset: 745 }, - }, - }, - ], - position: { - start: { line: 30, column: 17, offset: 741 }, - end: { line: 30, column: 22, offset: 746 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 30, column: 23, offset: 747 }, - end: { line: 30, column: 31, offset: 755 }, - }, - }, - ], - position: { - start: { line: 30, column: 22, offset: 746 }, - end: { line: 30, column: 32, offset: 756 }, - }, - }, - { - type: 'text', - value: '. The default value for the field. Accepts markdown content', - position: { - start: { line: 30, column: 32, offset: 756 }, - end: { line: 30, column: 91, offset: 815 }, - }, - }, - ], - position: { - start: { line: 30, column: 22, offset: 746 }, - end: { line: 30, column: 92, offset: 816 }, - }, - }, - ], - position: { - start: { line: 30, column: 1, offset: 725 }, - end: { line: 30, column: 92, offset: 816 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'media_library', - position: { - start: { line: 31, column: 2, offset: 818 }, - end: { line: 31, column: 15, offset: 831 }, - }, - }, - ], - position: { - start: { line: 31, column: 1, offset: 817 }, - end: { line: 31, column: 16, offset: 832 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Media Library Options', - position: { - start: { line: 31, column: 16, offset: 832 }, - end: { line: 31, column: 37, offset: 853 }, - }, - }, - ], - position: { - start: { line: 31, column: 16, offset: 832 }, - end: { line: 31, column: 38, offset: 854 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'inlineCode', - value: '{}', - position: { - start: { line: 31, column: 38, offset: 854 }, - end: { line: 31, column: 42, offset: 858 }, - }, - }, - ], - position: { - start: { line: 31, column: 38, offset: 854 }, - end: { line: 31, column: 43, offset: 859 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 31, column: 44, offset: 860 }, - end: { line: 31, column: 52, offset: 868 }, - }, - }, - ], - position: { - start: { line: 31, column: 43, offset: 859 }, - end: { line: 31, column: 53, offset: 869 }, - }, - }, - { - type: 'text', - value: - '. Media library settings to apply when a media library is opened by the current widget. See ', - position: { - start: { line: 31, column: 53, offset: 869 }, - end: { line: 31, column: 145, offset: 961 }, - }, - }, - { - type: 'link', - title: null, - url: '#media-library-options', - children: [ - { - type: 'text', - value: 'Media Library Options', - position: { - start: { line: 31, column: 146, offset: 962 }, - end: { line: 31, column: 167, offset: 983 }, - }, - }, - ], - position: { - start: { line: 31, column: 145, offset: 961 }, - end: { line: 31, column: 192, offset: 1008 }, - }, - }, - ], - position: { - start: { line: 31, column: 43, offset: 859 }, - end: { line: 31, column: 193, offset: 1009 }, - }, - }, - ], - position: { - start: { line: 31, column: 1, offset: 817 }, - end: { line: 31, column: 193, offset: 1009 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'media_folder', - position: { - start: { line: 32, column: 2, offset: 1011 }, - end: { line: 32, column: 14, offset: 1023 }, - }, - }, - ], - position: { - start: { line: 32, column: 1, offset: 1010 }, - end: { line: 32, column: 15, offset: 1024 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'string', - position: { - start: { line: 32, column: 15, offset: 1024 }, - end: { line: 32, column: 21, offset: 1030 }, - }, - }, - ], - position: { - start: { line: 32, column: 15, offset: 1024 }, - end: { line: 32, column: 22, offset: 1031 }, - }, - }, - { - type: 'tableCell', - children: [], - position: { - start: { line: 32, column: 22, offset: 1031 }, - end: { line: 32, column: 24, offset: 1033 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 32, column: 25, offset: 1034 }, - end: { line: 32, column: 33, offset: 1042 }, - }, - }, - ], - position: { - start: { line: 32, column: 24, offset: 1033 }, - end: { line: 32, column: 34, offset: 1043 }, - }, - }, - { - type: 'text', - value: - '. Specifies the folder path where uploaded files should be saved, relative to the base of the repo', - position: { - start: { line: 32, column: 34, offset: 1043 }, - end: { line: 32, column: 132, offset: 1141 }, - }, - }, - ], - position: { - start: { line: 32, column: 24, offset: 1033 }, - end: { line: 32, column: 133, offset: 1142 }, - }, - }, - ], - position: { - start: { line: 32, column: 1, offset: 1010 }, - end: { line: 32, column: 133, offset: 1142 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'public_folder', - position: { - start: { line: 33, column: 2, offset: 1144 }, - end: { line: 33, column: 15, offset: 1157 }, - }, - }, - ], - position: { - start: { line: 33, column: 1, offset: 1143 }, - end: { line: 33, column: 16, offset: 1158 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'string', - position: { - start: { line: 33, column: 16, offset: 1158 }, - end: { line: 33, column: 22, offset: 1164 }, - }, - }, - ], - position: { - start: { line: 33, column: 16, offset: 1158 }, - end: { line: 33, column: 23, offset: 1165 }, - }, - }, - { - type: 'tableCell', - children: [], - position: { - start: { line: 33, column: 23, offset: 1165 }, - end: { line: 33, column: 25, offset: 1167 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 33, column: 26, offset: 1168 }, - end: { line: 33, column: 34, offset: 1176 }, - }, - }, - ], - position: { - start: { line: 33, column: 25, offset: 1167 }, - end: { line: 33, column: 35, offset: 1177 }, - }, - }, - { - type: 'text', - value: - '. Specifies the folder path where the files uploaded by the media library will be accessed, relative to the base of the built site', - position: { - start: { line: 33, column: 35, offset: 1177 }, - end: { line: 33, column: 165, offset: 1307 }, - }, - }, - ], - position: { - start: { line: 33, column: 25, offset: 1167 }, - end: { line: 33, column: 166, offset: 1308 }, - }, - }, - ], - position: { - start: { line: 33, column: 1, offset: 1143 }, - end: { line: 33, column: 166, offset: 1308 }, - }, - }, - ], - position: { - start: { line: 28, column: 1, offset: 675 }, - end: { line: 33, column: 166, offset: 1308 }, - }, - }, - { - type: 'heading', - depth: 3, - children: [ - { - type: 'text', - value: 'Media Library Options', - position: { - start: { line: 35, column: 5, offset: 1314 }, - end: { line: 35, column: 26, offset: 1335 }, - }, - }, - ], - position: { - start: { line: 35, column: 1, offset: 1310 }, - end: { line: 35, column: 26, offset: 1335 }, - }, - }, - { - type: 'table', - align: [null, null, null, null], - children: [ - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Name', - position: { - start: { line: 37, column: 2, offset: 1338 }, - end: { line: 37, column: 6, offset: 1342 }, - }, - }, - ], - position: { - start: { line: 37, column: 1, offset: 1337 }, - end: { line: 37, column: 7, offset: 1343 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Type', - position: { - start: { line: 37, column: 7, offset: 1343 }, - end: { line: 37, column: 11, offset: 1347 }, - }, - }, - ], - position: { - start: { line: 37, column: 7, offset: 1343 }, - end: { line: 37, column: 12, offset: 1348 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Default', - position: { - start: { line: 37, column: 12, offset: 1348 }, - end: { line: 37, column: 19, offset: 1355 }, - }, - }, - ], - position: { - start: { line: 37, column: 12, offset: 1348 }, - end: { line: 37, column: 20, offset: 1356 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'Description', - position: { - start: { line: 37, column: 20, offset: 1356 }, - end: { line: 37, column: 31, offset: 1367 }, - }, - }, - ], - position: { - start: { line: 37, column: 20, offset: 1356 }, - end: { line: 37, column: 32, offset: 1368 }, - }, - }, - ], - position: { - start: { line: 37, column: 1, offset: 1337 }, - end: { line: 37, column: 32, offset: 1368 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'allow_multiple', - position: { - start: { line: 39, column: 2, offset: 1388 }, - end: { line: 39, column: 16, offset: 1402 }, - }, - }, - ], - position: { - start: { line: 39, column: 1, offset: 1387 }, - end: { line: 39, column: 17, offset: 1403 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'boolean', - position: { - start: { line: 39, column: 17, offset: 1403 }, - end: { line: 39, column: 24, offset: 1410 }, - }, - }, - ], - position: { - start: { line: 39, column: 17, offset: 1403 }, - end: { line: 39, column: 25, offset: 1411 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'inlineCode', - value: 'true', - position: { - start: { line: 39, column: 25, offset: 1411 }, - end: { line: 39, column: 31, offset: 1417 }, - }, - }, - ], - position: { - start: { line: 39, column: 25, offset: 1411 }, - end: { line: 39, column: 32, offset: 1418 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 39, column: 33, offset: 1419 }, - end: { line: 39, column: 41, offset: 1427 }, - }, - }, - ], - position: { - start: { line: 39, column: 32, offset: 1418 }, - end: { line: 39, column: 42, offset: 1428 }, - }, - }, - { - type: 'text', - value: '. When set to ', - position: { - start: { line: 39, column: 42, offset: 1428 }, - end: { line: 39, column: 56, offset: 1442 }, - }, - }, - { - type: 'inlineCode', - value: 'false', - position: { - start: { line: 39, column: 56, offset: 1442 }, - end: { line: 39, column: 63, offset: 1449 }, - }, - }, - { - type: 'text', - value: - ', prevents multiple selection for any media library extension, but must be supported by the extension in use', - position: { - start: { line: 39, column: 63, offset: 1449 }, - end: { line: 39, column: 171, offset: 1557 }, - }, - }, - ], - position: { - start: { line: 39, column: 32, offset: 1418 }, - end: { line: 39, column: 172, offset: 1558 }, - }, - }, - ], - position: { - start: { line: 39, column: 1, offset: 1387 }, - end: { line: 39, column: 172, offset: 1558 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'config', - position: { - start: { line: 40, column: 2, offset: 1560 }, - end: { line: 40, column: 8, offset: 1566 }, - }, - }, - ], - position: { - start: { line: 40, column: 1, offset: 1559 }, - end: { line: 40, column: 9, offset: 1567 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'string', - position: { - start: { line: 40, column: 9, offset: 1567 }, - end: { line: 40, column: 15, offset: 1573 }, - }, - }, - ], - position: { - start: { line: 40, column: 9, offset: 1567 }, - end: { line: 40, column: 16, offset: 1574 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'inlineCode', - value: '{}', - position: { - start: { line: 40, column: 16, offset: 1574 }, - end: { line: 40, column: 20, offset: 1578 }, - }, - }, - ], - position: { - start: { line: 40, column: 16, offset: 1574 }, - end: { line: 40, column: 21, offset: 1579 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 40, column: 22, offset: 1580 }, - end: { line: 40, column: 30, offset: 1588 }, - }, - }, - ], - position: { - start: { line: 40, column: 21, offset: 1579 }, - end: { line: 40, column: 31, offset: 1589 }, - }, - }, - { - type: 'text', - value: - '. A configuration object that will be passed directly to the media library being used - available options are determined by the library', - position: { - start: { line: 40, column: 31, offset: 1589 }, - end: { line: 40, column: 166, offset: 1724 }, - }, - }, - ], - position: { - start: { line: 40, column: 21, offset: 1579 }, - end: { line: 40, column: 167, offset: 1725 }, - }, - }, - ], - position: { - start: { line: 40, column: 1, offset: 1559 }, - end: { line: 40, column: 167, offset: 1725 }, - }, - }, - { - type: 'tableRow', - children: [ - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'choose_url', - position: { - start: { line: 41, column: 2, offset: 1727 }, - end: { line: 41, column: 12, offset: 1737 }, - }, - }, - ], - position: { - start: { line: 41, column: 1, offset: 1726 }, - end: { line: 41, column: 13, offset: 1738 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'text', - value: 'string', - position: { - start: { line: 41, column: 13, offset: 1738 }, - end: { line: 41, column: 19, offset: 1744 }, - }, - }, - { - type: 'html', - value: '
', - position: { - start: { line: 41, column: 19, offset: 1744 }, - end: { line: 41, column: 25, offset: 1750 }, - }, - }, - { - type: 'text', - value: '| boolean', - position: { - start: { line: 41, column: 25, offset: 1750 }, - end: { line: 41, column: 35, offset: 1760 }, - }, - }, - ], - position: { - start: { line: 41, column: 13, offset: 1738 }, - end: { line: 41, column: 36, offset: 1761 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'inlineCode', - value: 'true', - position: { - start: { line: 41, column: 36, offset: 1761 }, - end: { line: 41, column: 42, offset: 1767 }, - }, - }, - ], - position: { - start: { line: 41, column: 36, offset: 1761 }, - end: { line: 41, column: 43, offset: 1768 }, - }, - }, - { - type: 'tableCell', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Optional', - position: { - start: { line: 41, column: 44, offset: 1769 }, - end: { line: 41, column: 52, offset: 1777 }, - }, - }, - ], - position: { - start: { line: 41, column: 43, offset: 1768 }, - end: { line: 41, column: 53, offset: 1778 }, - }, - }, - { - type: 'text', - value: '. When set to ', - position: { - start: { line: 41, column: 53, offset: 1778 }, - end: { line: 41, column: 67, offset: 1792 }, - }, - }, - { - type: 'inlineCode', - value: 'false', - position: { - start: { line: 41, column: 67, offset: 1792 }, - end: { line: 41, column: 74, offset: 1799 }, - }, - }, - { - type: 'text', - value: ', the "Insert from URL" button will be hidden', - position: { - start: { line: 41, column: 74, offset: 1799 }, - end: { line: 41, column: 119, offset: 1844 }, - }, - }, - ], - position: { - start: { line: 41, column: 43, offset: 1768 }, - end: { line: 41, column: 120, offset: 1845 }, - }, - }, - ], - position: { - start: { line: 41, column: 1, offset: 1726 }, - end: { line: 41, column: 120, offset: 1845 }, - }, - }, - ], - position: { - start: { line: 37, column: 1, offset: 1337 }, - end: { line: 41, column: 120, offset: 1845 }, - }, - }, - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'Features', - position: { - start: { line: 43, column: 4, offset: 1850 }, - end: { line: 43, column: 12, offset: 1858 }, - }, - }, - ], - position: { - start: { line: 43, column: 1, offset: 1847 }, - end: { line: 43, column: 12, offset: 1858 }, - }, - }, - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'CommonMark + GFM Specifications', - position: { - start: { line: 45, column: 3, offset: 1862 }, - end: { line: 45, column: 34, offset: 1893 }, - }, - }, - ], - position: { - start: { line: 45, column: 3, offset: 1862 }, - end: { line: 45, column: 34, offset: 1893 }, - }, - }, - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Live ', - position: { - start: { line: 46, column: 5, offset: 1898 }, - end: { line: 46, column: 10, offset: 1903 }, - }, - }, - { - type: 'inlineCode', - value: 'Preview', - position: { - start: { line: 46, column: 10, offset: 1903 }, - end: { line: 46, column: 19, offset: 1912 }, - }, - }, - ], - position: { - start: { line: 46, column: 5, offset: 1898 }, - end: { line: 46, column: 19, offset: 1912 }, - }, - }, - ], - position: { - start: { line: 46, column: 3, offset: 1896 }, - end: { line: 46, column: 19, offset: 1912 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Auto Indent', - position: { - start: { line: 47, column: 5, offset: 1917 }, - end: { line: 47, column: 16, offset: 1928 }, - }, - }, - ], - position: { - start: { line: 47, column: 5, offset: 1917 }, - end: { line: 47, column: 16, offset: 1928 }, - }, - }, - ], - position: { - start: { line: 47, column: 3, offset: 1915 }, - end: { line: 47, column: 16, offset: 1928 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Syntax Highlight', - position: { - start: { line: 48, column: 5, offset: 1933 }, - end: { line: 48, column: 21, offset: 1949 }, - }, - }, - ], - position: { - start: { line: 48, column: 5, offset: 1933 }, - end: { line: 48, column: 21, offset: 1949 }, - }, - }, - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Rich Editor', - position: { - start: { line: 49, column: 10, offset: 1959 }, - end: { line: 49, column: 21, offset: 1970 }, - }, - }, - ], - position: { - start: { line: 49, column: 10, offset: 1959 }, - end: { line: 49, column: 21, offset: 1970 }, - }, - }, - ], - position: { - start: { line: 49, column: 7, offset: 1956 }, - end: { line: 49, column: 21, offset: 1970 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Preview', - position: { - start: { line: 50, column: 10, offset: 1980 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 50, column: 10, offset: 1980 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 50, column: 7, offset: 1977 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 49, column: 7, offset: 1956 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 48, column: 3, offset: 1931 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 46, column: 3, offset: 1896 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 45, column: 1, offset: 1860 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - ], - position: { - start: { line: 45, column: 1, offset: 1860 }, - end: { line: 50, column: 17, offset: 1987 }, - }, - }, - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'Formatting', - position: { - start: { line: 52, column: 4, offset: 1992 }, - end: { line: 52, column: 14, offset: 2002 }, - }, - }, - ], - position: { - start: { line: 52, column: 1, offset: 1989 }, - end: { line: 52, column: 14, offset: 2002 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'Bold', - position: { - start: { line: 54, column: 3, offset: 2006 }, - end: { line: 54, column: 7, offset: 2010 }, - }, - }, - ], - position: { - start: { line: 54, column: 1, offset: 2004 }, - end: { line: 54, column: 9, offset: 2012 }, - }, - }, - { - type: 'text', - value: ', ', - position: { - start: { line: 54, column: 9, offset: 2012 }, - end: { line: 54, column: 11, offset: 2014 }, - }, - }, - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Italic', - position: { - start: { line: 54, column: 12, offset: 2015 }, - end: { line: 54, column: 18, offset: 2021 }, - }, - }, - ], - position: { - start: { line: 54, column: 11, offset: 2014 }, - end: { line: 54, column: 19, offset: 2022 }, - }, - }, - { - type: 'text', - value: ', ', - position: { - start: { line: 54, column: 19, offset: 2022 }, - end: { line: 54, column: 21, offset: 2024 }, - }, - }, - { - type: 'emphasis', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'both', - position: { - start: { line: 54, column: 24, offset: 2027 }, - end: { line: 54, column: 28, offset: 2031 }, - }, - }, - ], - position: { - start: { line: 54, column: 22, offset: 2025 }, - end: { line: 54, column: 30, offset: 2033 }, - }, - }, - ], - position: { - start: { line: 54, column: 21, offset: 2024 }, - end: { line: 54, column: 31, offset: 2034 }, - }, - }, - ], - position: { - start: { line: 54, column: 1, offset: 2004 }, - end: { line: 54, column: 31, offset: 2034 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'delete', - children: [ - { - type: 'text', - value: 'Strikethrough', - position: { - start: { line: 56, column: 3, offset: 2038 }, - end: { line: 56, column: 16, offset: 2051 }, - }, - }, - ], - position: { - start: { line: 56, column: 1, offset: 2036 }, - end: { line: 56, column: 18, offset: 2053 }, - }, - }, - ], - position: { - start: { line: 56, column: 1, offset: 2036 }, - end: { line: 56, column: 18, offset: 2053 }, - }, - }, - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'Shortcodes', - position: { - start: { line: 58, column: 4, offset: 2058 }, - end: { line: 58, column: 14, offset: 2068 }, - }, - }, - ], - position: { - start: { line: 58, column: 1, offset: 2055 }, - end: { line: 58, column: 14, offset: 2068 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Text ahead [youtube|p6h-rYSVX90] and behind', - position: { - start: { line: 60, column: 1, offset: 2070 }, - end: { line: 60, column: 44, offset: 2113 }, - }, - }, - ], - position: { - start: { line: 60, column: 1, offset: 2070 }, - end: { line: 60, column: 44, offset: 2113 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '{{< twitter 917359331535966209 >}} Only behind text', - position: { - start: { line: 62, column: 1, offset: 2115 }, - end: { line: 62, column: 52, offset: 2166 }, - }, - }, - ], - position: { - start: { line: 62, column: 1, offset: 2115 }, - end: { line: 62, column: 52, offset: 2166 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Only text before {{< twitter 917359331535966209 >}}', - position: { - start: { line: 64, column: 1, offset: 2168 }, - end: { line: 64, column: 52, offset: 2219 }, - }, - }, - ], - position: { - start: { line: 64, column: 1, offset: 2168 }, - end: { line: 64, column: 52, offset: 2219 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: '[youtube|p6h-rYSVX90]', - position: { - start: { line: 66, column: 1, offset: 2221 }, - end: { line: 66, column: 22, offset: 2242 }, - }, - }, - ], - position: { - start: { line: 66, column: 1, offset: 2221 }, - end: { line: 66, column: 22, offset: 2242 }, - }, - }, - { - type: 'paragraph', - children: [ - { - type: 'text', - value: - 'Text ahead [youtube|p6h-rYSVX90] and behind and another {{< twitter 917359331535966209 >}} shortcode', - position: { - start: { line: 68, column: 1, offset: 2244 }, - end: { line: 68, column: 101, offset: 2344 }, - }, - }, - ], - position: { - start: { line: 68, column: 1, offset: 2244 }, - end: { line: 68, column: 101, offset: 2344 }, - }, - }, - { - type: 'heading', - depth: 2, - children: [ - { - type: 'text', - value: 'Support', - position: { - start: { line: 70, column: 4, offset: 2349 }, - end: { line: 70, column: 11, offset: 2356 }, - }, - }, - ], - position: { - start: { line: 70, column: 1, offset: 2346 }, - end: { line: 70, column: 11, offset: 2356 }, - }, - }, - { - type: 'blockquote', - children: [ - { - type: 'list', - ordered: false, - start: null, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Supports remark plugins', - position: { - start: { line: 72, column: 5, offset: 2362 }, - end: { line: 72, column: 28, offset: 2385 }, - }, - }, - ], - position: { - start: { line: 72, column: 5, offset: 2362 }, - end: { line: 72, column: 28, offset: 2385 }, - }, - }, - ], - position: { - start: { line: 72, column: 3, offset: 2360 }, - end: { line: 72, column: 28, offset: 2385 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: null, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'Supports wrappers', - position: { - start: { line: 73, column: 5, offset: 2390 }, - end: { line: 73, column: 22, offset: 2407 }, - }, - }, - ], - position: { - start: { line: 73, column: 5, offset: 2390 }, - end: { line: 73, column: 22, offset: 2407 }, - }, - }, - { - type: 'list', - ordered: true, - start: 1, - spread: false, - children: [ - { - type: 'listItem', - spread: false, - checked: true, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'React', - position: { - start: { line: 74, column: 13, offset: 2420 }, - end: { line: 74, column: 18, offset: 2425 }, - }, - }, - ], - position: { - start: { line: 74, column: 13, offset: 2420 }, - end: { line: 74, column: 18, offset: 2425 }, - }, - }, - ], - position: { - start: { line: 74, column: 6, offset: 2413 }, - end: { line: 74, column: 18, offset: 2425 }, - }, - }, - { - type: 'listItem', - spread: false, - checked: false, - children: [ - { - type: 'paragraph', - children: [ - { - type: 'text', - value: 'More coming soon', - position: { - start: { line: 75, column: 13, offset: 2438 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 75, column: 13, offset: 2438 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 75, column: 6, offset: 2431 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 74, column: 6, offset: 2413 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 73, column: 3, offset: 2388 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 72, column: 3, offset: 2360 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 72, column: 1, offset: 2358 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 75, column: 29, offset: 2454 }, - }, - }, slate: [ { type: 'h1', @@ -6833,45 +2683,41 @@ Text ahead [youtube|p6h-rYSVX90] and behind and another {{< twitter 917359331535 }; export const deserializationOnlyTestData: SerializationTests = { + paragraph: { + markdown: { + 'paragraph with link': { + markdown: + 'A line of text with a link https://www.youtube.com/watch?v=p6h-rYSVX90 and some more text', + slate: [ + { + type: ELEMENT_PARAGRAPH, + children: [ + { + text: 'A line of text with a link ', + }, + { + type: ELEMENT_LINK, + url: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + children: [ + { + text: 'https://www.youtube.com/watch?v=p6h-rYSVX90', + }, + ], + }, + { + text: ' and some more text', + }, + ], + }, + ] as MdValue, + }, + }, + }, + italic: { both: { 'italic (using *)': { markdown: '*Italic*', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Italic', - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 8, offset: 7 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -6891,41 +2737,6 @@ export const deserializationOnlyTestData: SerializationTests = { both: { 'bold (using __)': { markdown: '__Bold__', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'Bold', - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 7, offset: 6 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 9, offset: 8 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -6945,50 +2756,6 @@ export const deserializationOnlyTestData: SerializationTests = { both: { 'bold and italic (using ___)': { markdown: '___Bold and Italic___', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'Bold and Italic', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7005,50 +2772,6 @@ export const deserializationOnlyTestData: SerializationTests = { 'bold and italic (using **_)': { markdown: '**_Bold and Italic_**', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'strong', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Bold and Italic', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 20, offset: 19 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7065,50 +2788,6 @@ export const deserializationOnlyTestData: SerializationTests = { 'bold and italic (using __*)': { markdown: '__*Bold and Italic*__', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'strong', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'text', - value: 'Bold and Italic', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 3, offset: 2 }, - end: { line: 1, column: 20, offset: 19 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7125,50 +2804,6 @@ export const deserializationOnlyTestData: SerializationTests = { 'bold and italic (using *__)': { markdown: '*__Bold and Italic__*', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'emphasis', - children: [ - { - type: 'strong', - children: [ - { - type: 'text', - value: 'Bold and Italic', - position: { - start: { line: 1, column: 4, offset: 3 }, - end: { line: 1, column: 19, offset: 18 }, - }, - }, - ], - position: { - start: { line: 1, column: 2, offset: 1 }, - end: { line: 1, column: 21, offset: 20 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 22, offset: 21 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7189,43 +2824,6 @@ export const deserializationOnlyTestData: SerializationTests = { mdx: { 'color attribute of font tag': { markdown: 'Colored Text', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'font', - attributes: [{ type: 'mdxJsxAttribute', name: 'color', value: 'red' }], - children: [ - { - type: 'text', - value: 'Colored Text', - position: { - start: { line: 1, column: 19, offset: 18 }, - end: { line: 1, column: 31, offset: 30 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 38, offset: 37 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 38, offset: 37 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 38, offset: 37 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7242,53 +2840,6 @@ export const deserializationOnlyTestData: SerializationTests = { 'color and style attributes of font tag together (favoring color)': { markdown: "Colored Text", - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'font', - attributes: [ - { type: 'mdxJsxAttribute', name: 'color', value: 'blue' }, - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ color: 'red', backgroundColor: 'black' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Colored Text', - position: { - start: { line: 1, column: 71, offset: 70 }, - end: { line: 1, column: 83, offset: 82 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 90, offset: 89 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 90, offset: 89 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 90, offset: 89 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7309,43 +2860,6 @@ export const deserializationOnlyTestData: SerializationTests = { mdx: { 'align attribute of paragraph tag': { markdown: '

Aligned Left

', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'p', - attributes: [{ type: 'mdxJsxAttribute', name: 'align', value: 'left' }], - children: [ - { - type: 'text', - value: 'Aligned Left', - position: { - start: { line: 1, column: 17, offset: 16 }, - end: { line: 1, column: 29, offset: 28 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 33, offset: 32 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 33, offset: 32 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 33, offset: 32 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7361,53 +2875,6 @@ export const deserializationOnlyTestData: SerializationTests = { 'align and style attributes of font paragraph together (favoring align)': { markdown: '

Aligned Center

', - mdast: { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'mdxJsxTextElement', - name: 'p', - attributes: [ - { type: 'mdxJsxAttribute', name: 'align', value: 'center' }, - { - type: 'mdxJsxAttribute', - name: 'style', - value: { - type: 'mdxJsxAttributeValueExpression', - value: "{ textAlign: 'center' }", - }, - }, - ], - children: [ - { - type: 'text', - value: 'Aligned Center', - position: { - start: { line: 1, column: 51, offset: 50 }, - end: { line: 1, column: 65, offset: 64 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 69, offset: 68 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 69, offset: 68 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 69, offset: 68 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, @@ -7427,25 +2894,6 @@ export const deserializationOnlyTestData: SerializationTests = { mdx: { 'break tag': { markdown: '
', - mdast: { - type: 'root', - children: [ - { - type: 'mdxJsxFlowElement', - name: 'br', - attributes: [], - children: [], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 7, offset: 6 }, - }, - }, - ], - position: { - start: { line: 1, column: 1, offset: 0 }, - end: { line: 1, column: 7, offset: 6 }, - }, - }, slate: [ { type: ELEMENT_PARAGRAPH, diff --git a/yarn.lock b/yarn.lock index f189cca1..673c9f2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12779,7 +12779,7 @@ mdast-util-gfm-autolink-literal@^1.0.0: mdast-util-find-and-replace "^2.0.0" micromark-util-character "^1.0.0" -mdast-util-gfm-footnote@^1.0.0: +mdast-util-gfm-footnote@1.0.2, mdast-util-gfm-footnote@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz#ce5e49b639c44de68d5bf5399877a14d5020424e" integrity sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ== @@ -12788,7 +12788,7 @@ mdast-util-gfm-footnote@^1.0.0: mdast-util-to-markdown "^1.3.0" micromark-util-normalize-identifier "^1.0.0" -mdast-util-gfm-strikethrough@^1.0.0: +mdast-util-gfm-strikethrough@1.0.3, mdast-util-gfm-strikethrough@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz#5470eb105b483f7746b8805b9b989342085795b7" integrity sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ== @@ -12796,7 +12796,7 @@ mdast-util-gfm-strikethrough@^1.0.0: "@types/mdast" "^3.0.0" mdast-util-to-markdown "^1.3.0" -mdast-util-gfm-table@^1.0.0: +mdast-util-gfm-table@1.0.7, mdast-util-gfm-table@^1.0.0: version "1.0.7" resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz#3552153a146379f0f9c4c1101b071d70bbed1a46" integrity sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg== @@ -12806,7 +12806,7 @@ mdast-util-gfm-table@^1.0.0: mdast-util-from-markdown "^1.0.0" mdast-util-to-markdown "^1.3.0" -mdast-util-gfm-task-list-item@^1.0.0: +mdast-util-gfm-task-list-item@1.0.2, mdast-util-gfm-task-list-item@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz#b280fcf3b7be6fd0cc012bbe67a59831eb34097b" integrity sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ== @@ -13043,6 +13043,20 @@ micromark-extension-gfm-autolink-literal@^1.0.0: micromark-util-types "^1.0.0" uvu "^0.5.0" +micromark-extension-gfm-footnote@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.0.tgz#73e3db823db9defef25f68074cb4cf4bb9cf6a8c" + integrity sha512-RWYce7j8+c0n7Djzv5NzGEGitNNYO3uj+h/XYMdS/JinH1Go+/Qkomg/rfxExFzYTiydaV6GLeffGO5qcJbMPA== + dependencies: + micromark-core-commonmark "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + micromark-extension-gfm-footnote@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.4.tgz#cbfd8873b983e820c494498c6dac0105920818d5" @@ -13057,7 +13071,7 @@ micromark-extension-gfm-footnote@^1.0.0: micromark-util-types "^1.0.0" uvu "^0.5.0" -micromark-extension-gfm-strikethrough@^1.0.0: +micromark-extension-gfm-strikethrough@1.0.5, micromark-extension-gfm-strikethrough@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.5.tgz#4db40b87d674a6fe1d00d59ac91118e4f5960f12" integrity sha512-X0oI5eYYQVARhiNfbETy7BfLSmSilzN1eOuoRnrf9oUNsPRrWOAe9UqSizgw1vNxQBfOwL+n2610S3bYjVNi7w== @@ -13069,7 +13083,7 @@ micromark-extension-gfm-strikethrough@^1.0.0: micromark-util-types "^1.0.0" uvu "^0.5.0" -micromark-extension-gfm-table@^1.0.0: +micromark-extension-gfm-table@1.0.5, micromark-extension-gfm-table@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz#7b708b728f8dc4d95d486b9e7a2262f9cddbcbb4" integrity sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg== @@ -13087,7 +13101,7 @@ micromark-extension-gfm-tagfilter@^1.0.0: dependencies: micromark-util-types "^1.0.0" -micromark-extension-gfm-task-list-item@^1.0.0: +micromark-extension-gfm-task-list-item@1.0.4, micromark-extension-gfm-task-list-item@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.4.tgz#4b66d87847de40cef2b5ceddb9f9629a6dfe7472" integrity sha512-9XlIUUVnYXHsFF2HZ9jby4h3npfX10S1coXTnV035QGPgrtNYQq3J6IfIvcCIUAJrrqBVi5BqA/LmaOMJqPwMQ== @@ -13261,7 +13275,7 @@ micromark-util-classify-character@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" -micromark-util-combine-extensions@^1.0.0: +micromark-util-combine-extensions@1.0.0, micromark-util-combine-extensions@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz#91418e1e74fb893e3628b8d496085639124ff3d5" integrity sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==