From dc0927b9de8731c7ea407febe3e8e7fb3008ef3f Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 1 Dec 2023 15:30:16 +0800 Subject: [PATCH] feat: options.target add MDX 3.0 support BREAKING CHANGE: wrapping `img-html-base64/inline-svg` in paragraph --- README.md | 92 +++++++++- lib/ast.mjs | 20 +++ lib/fetch.mjs | 18 ++ lib/index.mjs | 5 +- lib/transform.mjs | 145 ++++++++++++---- lib/utils.mjs | 50 ++---- lib/validate.mjs | 12 +- package.json | 5 +- pnpm-lock.yaml | 247 +++++++++++++++++++++++++++ test/helper/lib.mjs | 12 +- test/output.mjs | 44 +++-- test/snapshots/base.mjs.md | 32 ++-- test/snapshots/base.mjs.snap | Bin 1883 -> 1964 bytes test/snapshots/fail.mjs.md | 32 ++-- test/snapshots/fail.mjs.snap | Bin 3089 -> 3204 bytes test/snapshots/output.mjs.md | 278 ++++++++++++++++++++++++++----- test/snapshots/output.mjs.snap | Bin 2529 -> 3492 bytes test/snapshots/validate.mjs.md | 30 +++- test/snapshots/validate.mjs.snap | Bin 417 -> 444 bytes test/validate.mjs | 9 + 20 files changed, 868 insertions(+), 163 deletions(-) create mode 100644 lib/ast.mjs create mode 100644 lib/fetch.mjs diff --git a/README.md b/README.md index 06ba60a..f47bf74 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,36 @@ remark() .catch((error) => console.warn(error)); ``` -### Docusaurus project +### Docusaurus v3 project + +```mjs +// docusaurus.config.mjs +import { remarkKroki } from 'remark-kroki'; + +export default { + presets: [ + [ + 'classic', + { + docs: { + remarkPlugins: [ + [ + remarkKroki, + { + // ...options here + alias: ['plantuml'], + target: 'mdx3' + } + ] + ] + } + } + ] + ] +}; +``` + +### Docusaurus v2 project ```cjs // docusaurus.config.js @@ -94,6 +123,14 @@ HTTP headers to send to the server for custom authentication. Alias code language name to treat as kroki code block, meta.type will be ignored. +### Options.target + +- type: string +- default: `'html'` +- enum: `['html', 'mdx3']` + +Transform HTML tags as MDX 3.0 AST or not. When you using Docusaurus v3, you should use `mdx3`. + ### Options.output - type: string @@ -138,8 +175,61 @@ Into ``` ```` +## Troubleshooting + +When you using `inline-svg` with `mdx3` mode, You may get following error: + +```log +Error: Cannot handle unknown node `raw` when using with `@mdx-js/mdx` +``` + +You need to add `rehype-raw` to the complier, for example: + +```mjs +// docusaurus.config.mjs +import rehypeRaw from 'rehype-raw'; +import { remarkKroki } from 'remark-kroki'; + +export default { + presets: [ + [ + 'classic', + { + docs: { + remarkPlugins: [ + [ + remarkKroki, + { + // ...options here + target: 'mdx3', + output: 'inline-svg' + } + ] + ], + rehypePlugins: [ + [ + rehypeRaw, + { + passThrough: [ + 'mdxFlowExpression', + 'mdxJsxFlowElement', + 'mdxJsxTextElement', + 'mdxTextExpression', + 'mdxjsEsm' + ] + } + ] + ] + } + } + ] + ] +}; +``` + ## Related - [markdown-code-block-meta](https://github.com/nice-move/markdown-code-block-meta) +- [rehype-extended-table](https://github.com/nice-move/rehype-extended-table) - [remark-code-example](https://github.com/nice-move/remark-code-example) - [remark-docusaurus](https://github.com/nice-move/remark-docusaurus) diff --git a/lib/ast.mjs b/lib/ast.mjs new file mode 100644 index 0000000..5e43f5c --- /dev/null +++ b/lib/ast.mjs @@ -0,0 +1,20 @@ +function attrString(attributes = []) { + return attributes.length > 0 + ? attributes.map(({ name, value }) => ` ${name}="${value}"`).join('') + : ''; +} + +export function create(target, ast) { + if (target === 'mdx3') { + return ast; + } + + const { name, attributes, children: [{ value: child } = {}] = [] } = ast; + + return { + type: target, + value: child + ? [`<${name}${attrString(attributes)}>`, child, ``].join('') + : `<${name}${attrString(attributes)} />`, + }; +} diff --git a/lib/fetch.mjs b/lib/fetch.mjs new file mode 100644 index 0000000..35a1d40 --- /dev/null +++ b/lib/fetch.mjs @@ -0,0 +1,18 @@ +import nodeFetch from 'node-fetch'; + +export function httpPost({ url, body, headers }) { + return nodeFetch(url, { + method: 'POST', + body, + headers: { + ...headers, + 'Content-Type': 'text/plain', + }, + }).then(async (response) => { + if (!response.ok) { + throw new Error(await response.text()); + } + + return response.arrayBuffer(); + }); +} diff --git a/lib/index.mjs b/lib/index.mjs index 917b89d..0ba298f 100644 --- a/lib/index.mjs +++ b/lib/index.mjs @@ -9,8 +9,9 @@ export function remarkKroki({ headers = {}, alias = [], output = outputType[0], + target = 'html', } = {}) { - validate({ server, headers, alias, output }); + validate({ server, headers, alias, output, target }); const condition = isKroki(alias); @@ -18,7 +19,7 @@ export function remarkKroki({ const temp = []; visit(tree, condition, (node) => { - temp.push(transform({ node, server, headers, output })); + temp.push(transform({ node, server, headers, output, target })); }); // eslint-disable-next-line no-empty diff --git a/lib/transform.mjs b/lib/transform.mjs index 4f8ec5a..9671a93 100644 --- a/lib/transform.mjs +++ b/lib/transform.mjs @@ -1,5 +1,6 @@ import { getValue, parse } from 'markdown-code-block-meta'; +import { create } from './ast.mjs'; import { fetchData, mime, toDataURL } from './utils.mjs'; /* eslint-disable no-param-reassign */ @@ -9,39 +10,125 @@ function removeXML(string) { } const modes = { - 'img-base64': ({ node, diagramType, data, alt }) => { - node.type = 'paragraph'; - node.children = [ - { - type: 'image', - alt: alt || diagramType, - url: toDataURL(data), - }, - ]; + 'img-base64': ({ diagramType, data, alt }) => { + return { + type: 'paragraph', + children: [ + { + type: 'image', + _meta: { kroki: true, type: diagramType }, + alt: alt || diagramType, + url: toDataURL(data), + }, + ], + }; }, - 'object-base64': ({ node, diagramType, data, alt }) => { - node.type = 'html'; - node.value = `Load SVG fail...`; + 'object-base64': ({ target, diagramType, data, alt }) => { + return create(target, { + type: 'mdxJsxFlowElement', + name: 'object', + children: [ + { + type: 'text', + value: 'Load SVG fail...', + }, + ], + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'type', + value: mime, + }, + { + type: 'mdxJsxAttribute', + name: 'class', + value: 'kroki-object', + }, + { + type: 'mdxJsxAttribute', + name: 'data-type', + value: diagramType, + }, + { + type: 'mdxJsxAttribute', + name: 'title', + value: alt || diagramType, + }, + { + type: 'mdxJsxAttribute', + name: 'data', + value: toDataURL(data), + }, + ], + }); }, - 'img-html-base64': ({ node, diagramType, data, alt }) => { - node.type = 'html'; - node.value = `${
-      alt || diagramType
-    }`; + 'img-html-base64': ({ target, diagramType, data, alt }) => { + return { + type: 'paragraph', + children: [ + create(target, { + type: 'mdxJsxTextElement', + name: 'img', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'class', + value: 'kroki-image', + }, + { + type: 'mdxJsxAttribute', + name: 'alt', + value: alt || diagramType, + }, + { + type: 'mdxJsxAttribute', + name: 'data-type', + value: diagramType, + }, + { + type: 'mdxJsxAttribute', + name: 'src', + value: toDataURL(data), + }, + ], + }), + ], + }; }, - 'inline-svg': ({ node, diagramType, data, alt }) => { - node.type = 'html'; - node.value = `
${removeXML(data.toString())}
`; + 'inline-svg': ({ target, diagramType, data, alt }) => { + return create(target, { + type: 'mdxJsxFlowElement', + name: 'p', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'class', + value: 'kroki-inline-svg', + }, + { + type: 'mdxJsxAttribute', + name: 'data-type', + value: diagramType, + }, + { + type: 'mdxJsxAttribute', + name: 'data-alt', + value: alt || diagramType, + }, + ], + children: [ + { + type: 'html', + value: removeXML(data.toString()), + }, + ], + }); }, }; export const outputType = Object.keys(modes); -export async function transform({ node, server, headers, output }) { +export async function transform({ node, server, headers, output, target }) { const { meta, value, lang } = node; const object = parse(meta); @@ -58,9 +145,9 @@ export async function transform({ node, server, headers, output }) { value, }); - delete node.lang; - delete node.value; - delete node.meta; + for (const key of Object.keys(node)) { + delete node[key]; + } - modes[output]({ node, diagramType, data, alt }); + Object.assign(node, modes[output]({ diagramType, data, alt, target })); } diff --git a/lib/utils.mjs b/lib/utils.mjs index b55c0d1..01b142b 100644 --- a/lib/utils.mjs +++ b/lib/utils.mjs @@ -1,9 +1,10 @@ import { readFileSync } from 'node:fs'; import { parse } from 'markdown-code-block-meta'; -import nodeFetch from 'node-fetch'; import pMemoize from 'p-memoize'; +import { httpPost } from './fetch.mjs'; + export function isKroki(alias = []) { return ({ type, lang, meta, value }) => { return ( @@ -16,52 +17,31 @@ export function isKroki(alias = []) { }; } -const fail = readFileSync(new URL('fail.svg', import.meta.url), 'utf8'); +const failImage = new URL('fail.svg', import.meta.url); -function createFailImageBuffer(message) { - return Buffer.from(fail.replace('======', message.slice(0, 500))); +function createFailImage(message) { + return readFileSync(failImage, 'utf8').replace( + '======', + message.slice(0, 500), + ); } -function Fetch({ server, headers = {}, type, value }) { - return nodeFetch(`${server}/${type}/svg`, { - method: 'POST', +function Fetch({ server, headers, type, value }) { + return httpPost({ + url: `${server}/${type}/svg`, body: value, - headers: { - ...headers, - 'Content-Type': 'text/plain', - }, + headers, }) - .then( - (response) => { - if (!response.ok || response.statusCode >= 400) { - if (response.statusCode === 404) { - return 'Error: 404'; - } - - return response.text(); - } - - return response.arrayBuffer(); - }, - (error) => `Error: ${error.message}`, - ) - .then((data) => - typeof data === 'string' - ? createFailImageBuffer(data) - : Buffer.from(data), - ); + .catch((error) => createFailImage(error.message)) + .then((data) => Buffer.from(data)); } export const mime = 'image/svg+xml'; -function base64Url(base64) { - return `data:${mime};base64,${base64}`; -} - export function toDataURL(buffer) { const base64 = buffer.toString('base64'); - return base64Url(base64); + return `data:${mime};base64,${base64}`; } export const fetchData = pMemoize(Fetch, { diff --git a/lib/validate.mjs b/lib/validate.mjs index ebbec59..18c91a7 100644 --- a/lib/validate.mjs +++ b/lib/validate.mjs @@ -4,7 +4,9 @@ import isPlainObject from 'is-plain-obj'; import { outputType } from './transform.mjs'; -export function validate({ server, headers, alias, output }) { +const targets = ['html', 'mdx3']; + +export function validate({ server, headers, alias, output, target }) { try { assert( typeof server === 'string', @@ -43,13 +45,13 @@ export function validate({ server, headers, alias, output }) { ); assert( - typeof output === 'string', - new TypeError('`output` should be string'), + outputType.includes(output), + new TypeError(`\`output\` should be one of \`${outputType.join('/')}\``), ); assert( - outputType.includes(output), - new TypeError(`\`output\` should be one of \`${outputType.join('/')}\``), + targets.includes(target), + new TypeError(`\`target\` should be one of \`${targets.join('/')}\``), ); } catch (error) { throw error.actual || error; diff --git a/package.json b/package.json index 4661267..53502b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remark-kroki", - "version": "0.2.12", + "version": "0.3.0", "description": "Remark plugin for showing Kroki diagram", "license": "MIT", "author": { @@ -66,6 +66,7 @@ "garou": "^0.6.19", "prettier": "^3.1.0", "remark": "^15.0.1", + "remark-mdx": "^3.0.0", "unist-util-remove-position": "^5.0.0" }, "engines": { @@ -75,7 +76,7 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, - "packageManager": "pnpm@8.10.5", + "packageManager": "pnpm@8.11.0", "eslintConfig": { "extends": "@nice-move/eslint-config-base" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 31c1fab..f824d43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,9 @@ devDependencies: remark: specifier: ^15.0.1 version: 15.0.1 + remark-mdx: + specifier: ^3.0.0 + version: 3.0.0 unist-util-remove-position: specifier: ^5.0.0 version: 5.0.0 @@ -512,6 +515,12 @@ packages: prettier: 3.1.0 dev: true + /@types/acorn@4.0.6: + resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} + dependencies: + '@types/estree': 1.0.2 + dev: true + /@types/debug@4.1.9: resolution: {integrity: sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==} dependencies: @@ -525,10 +534,22 @@ packages: '@types/json-schema': 7.0.13 dev: true + /@types/estree-jsx@1.0.3: + resolution: {integrity: sha512-pvQ+TKeRHeiUGRhvYwRrQ/ISnohKkSJR14fT2yqyZ4e9K5vqc7hrtY2Y1Dw0ZwAzQ6DQsxsaCUuSIIi8v0Cq6w==} + dependencies: + '@types/estree': 1.0.2 + dev: true + /@types/estree@1.0.2: resolution: {integrity: sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==} dev: true + /@types/hast@3.0.3: + resolution: {integrity: sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==} + dependencies: + '@types/unist': 3.0.0 + dev: true + /@types/json-schema@7.0.13: resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} dev: true @@ -1032,6 +1053,10 @@ packages: nofilter: 3.1.0 dev: true + /ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + dev: true + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1054,10 +1079,18 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + dev: true + /character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} dev: true + /character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + dev: true + /character-entities@1.2.4: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} dev: true @@ -1070,6 +1103,10 @@ packages: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: true + /character-reference-invalid@2.0.1: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + dev: true + /chevrotain@7.1.1: resolution: {integrity: sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==} dependencies: @@ -1841,6 +1878,17 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-util-is-identifier-name@3.0.0: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + dev: true + + /estree-util-visit@2.0.0: + resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} + dependencies: + '@types/estree-jsx': 1.0.3 + '@types/unist': 3.0.0 + dev: true + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2263,6 +2311,10 @@ packages: resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} dev: true + /is-alphabetical@2.0.1: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + dev: true + /is-alphanumerical@1.0.4: resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} dependencies: @@ -2270,6 +2322,13 @@ packages: is-decimal: 1.0.4 dev: true + /is-alphanumerical@2.0.1: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 + dev: true + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -2332,6 +2391,10 @@ packages: resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} dev: true + /is-decimal@2.0.1: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + dev: true + /is-error@2.2.2: resolution: {integrity: sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==} dev: true @@ -2362,6 +2425,10 @@ packages: resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} dev: true + /is-hexadecimal@2.0.1: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + dev: true + /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -2660,6 +2727,64 @@ packages: - supports-color dev: true + /mdast-util-mdx-expression@2.0.0: + resolution: {integrity: sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==} + dependencies: + '@types/estree-jsx': 1.0.3 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /mdast-util-mdx-jsx@3.0.0: + resolution: {integrity: sha512-XZuPPzQNBPAlaqsTTgRrcJnyFbSOBovSadFgbFu8SnuNgm+6Bdx1K+IWoitsmj6Lq6MNtI+ytOqwN70n//NaBA==} + dependencies: + '@types/estree-jsx': 1.0.3 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.1 + '@types/unist': 3.0.0 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + parse-entities: 4.0.1 + stringify-entities: 4.0.3 + unist-util-remove-position: 5.0.0 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /mdast-util-mdx@3.0.0: + resolution: {integrity: sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==} + dependencies: + mdast-util-from-markdown: 2.0.0 + mdast-util-mdx-expression: 2.0.0 + mdast-util-mdx-jsx: 3.0.0 + mdast-util-mdxjs-esm: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /mdast-util-mdxjs-esm@2.0.1: + resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + dependencies: + '@types/estree-jsx': 1.0.3 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + dev: true + /mdast-util-phrasing@4.0.0: resolution: {integrity: sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==} dependencies: @@ -2728,6 +2853,67 @@ packages: micromark-util-types: 2.0.0 dev: true + /micromark-extension-mdx-expression@3.0.0: + resolution: {integrity: sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ==} + dependencies: + '@types/estree': 1.0.2 + devlop: 1.1.0 + micromark-factory-mdx-expression: 2.0.1 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: true + + /micromark-extension-mdx-jsx@3.0.0: + resolution: {integrity: sha512-uvhhss8OGuzR4/N17L1JwvmJIpPhAd8oByMawEKx6NVdBCbesjH4t+vjEp3ZXft9DwvlKSD07fCeI44/N0Vf2w==} + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.2 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + micromark-factory-mdx-expression: 2.0.1 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + vfile-message: 4.0.2 + dev: true + + /micromark-extension-mdx-md@2.0.0: + resolution: {integrity: sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==} + dependencies: + micromark-util-types: 2.0.0 + dev: true + + /micromark-extension-mdxjs-esm@3.0.0: + resolution: {integrity: sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==} + dependencies: + '@types/estree': 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + dev: true + + /micromark-extension-mdxjs@3.0.0: + resolution: {integrity: sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==} + dependencies: + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + micromark-extension-mdx-expression: 3.0.0 + micromark-extension-mdx-jsx: 3.0.0 + micromark-extension-mdx-md: 2.0.0 + micromark-extension-mdxjs-esm: 3.0.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-types: 2.0.0 + dev: true + /micromark-factory-destination@2.0.0: resolution: {integrity: sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==} dependencies: @@ -2745,6 +2931,19 @@ packages: micromark-util-types: 2.0.0 dev: true + /micromark-factory-mdx-expression@2.0.1: + resolution: {integrity: sha512-F0ccWIUHRLRrYp5TC9ZYXmZo+p2AM13ggbsW4T0b5CRKP8KHVRB8t4pwtBgTxtjRmwrK0Irwm7vs2JOZabHZfg==} + dependencies: + '@types/estree': 1.0.2 + devlop: 1.1.0 + micromark-util-character: 2.0.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + dev: true + /micromark-factory-space@2.0.0: resolution: {integrity: sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==} dependencies: @@ -2817,6 +3016,19 @@ packages: resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} dev: true + /micromark-util-events-to-acorn@2.0.2: + resolution: {integrity: sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==} + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.2 + '@types/unist': 3.0.0 + devlop: 1.1.0 + estree-util-visit: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + vfile-message: 4.0.2 + dev: true + /micromark-util-html-tag-name@2.0.0: resolution: {integrity: sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==} dev: true @@ -3150,6 +3362,19 @@ packages: is-hexadecimal: 1.0.4 dev: true + /parse-entities@4.0.1: + resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} + dependencies: + '@types/unist': 2.0.8 + character-entities: 2.0.2 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.0.2 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -3321,6 +3546,15 @@ packages: jsesc: 0.5.0 dev: true + /remark-mdx@3.0.0: + resolution: {integrity: sha512-O7yfjuC6ra3NHPbRVxfflafAj3LTwx3b73aBvkEFU5z4PsD6FD4vrqJAkE5iNGLz71GdjXfgRqm3SQ0h0VuE7g==} + dependencies: + mdast-util-mdx: 3.0.0 + micromark-extension-mdxjs: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /remark-parse@11.0.0: resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} dependencies: @@ -3585,6 +3819,13 @@ packages: es-abstract: 1.22.2 dev: true + /stringify-entities@4.0.3: + resolution: {integrity: sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==} + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + dev: true + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -3828,6 +4069,12 @@ packages: dependencies: '@types/unist': 3.0.0 + /unist-util-position-from-estree@2.0.0: + resolution: {integrity: sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==} + dependencies: + '@types/unist': 3.0.0 + dev: true + /unist-util-remove-position@5.0.0: resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} dependencies: diff --git a/test/helper/lib.mjs b/test/helper/lib.mjs index 832c50c..07c69f3 100644 --- a/test/helper/lib.mjs +++ b/test/helper/lib.mjs @@ -1,4 +1,5 @@ import { remark } from 'remark'; +import remarkMdx from 'remark-mdx'; import { removePosition } from 'unist-util-remove-position'; import { remarkKroki } from '../../lib/index.mjs'; @@ -24,20 +25,21 @@ export async function transform(input, option = {}) { } export async function TransformSnapshot(t, input, option = {}, slice = false) { - const instance = remark().use(remarkKroki, option); + const instance = remark().use(remarkMdx).use(remarkKroki, option); const ast = instance.parse(input); - t.snapshot(input); - t.snapshot(removePST(ast)); + t.snapshot(input, 'input'); + t.snapshot(removePST(ast), 'ast'); const tree = removePST(await instance.run(ast)); - t.snapshot(tree); + t.snapshot(tree, 'parsed'); const output = await instance .process(input) .then((file) => file.toString().trim()) .then((text) => (slice ? text.slice(0, 4000) : text)); - t.snapshot(output); + + t.snapshot(output, 'result'); } diff --git a/test/output.mjs b/test/output.mjs index b7dafca..fdd5bd4 100644 --- a/test/output.mjs +++ b/test/output.mjs @@ -2,25 +2,33 @@ import test from 'ava'; import { TransformSnapshot } from './helper/lib.mjs'; -function macro(t, { output }) { - return TransformSnapshot( - t, - ` - \`\`\`kroki type=plantuml - A --> B - \`\`\` - `, - { - server: 'https://kroki.io', - output, - }, - ); -} +test.before((t) => { + t.timeout(1000 ** 3); +}); + +const source = ` +\`\`\`kroki type=plantuml + A --> B +\`\`\` +`; -test('inline-svg', macro, { output: 'inline-svg' }); +function macro(t, options) { + return TransformSnapshot(t, source, { + ...options, + server: 'https://kroki.io', + }); +} -test('img-base64', macro, { output: 'img-base64' }); +const mode = ['inline-svg', 'img-base64', 'img-html-base64', 'object-base64']; -test('img-html-base64', macro, { output: 'img-html-base64' }); +const targets = ['html', 'mdx3']; -test('object-base64', macro, { output: 'object-base64' }); +for (const output of mode) { + if (output === mode[1]) { + test(output, macro, { output }); + } else { + for (const target of targets) { + test(`${output} | ${target}`, macro, { output, target }); + } + } +} diff --git a/test/snapshots/base.mjs.md b/test/snapshots/base.mjs.md index 0b50d6c..6ccf2b5 100644 --- a/test/snapshots/base.mjs.md +++ b/test/snapshots/base.mjs.md @@ -6,7 +6,7 @@ Generated by [AVA](https://avajs.dev). ## empty -> Snapshot 1 +> input `␊ \`\`\`kroki␊ @@ -16,7 +16,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -33,7 +33,7 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { @@ -50,7 +50,7 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 4 +> result `\`\`\`kroki␊ \`\`\`␊ @@ -60,7 +60,7 @@ Generated by [AVA](https://avajs.dev). ## okay -> Snapshot 1 +> input `␊ \`\`\`kroki type=plantuml alt=abc␊ @@ -68,7 +68,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -79,12 +79,16 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { children: [ { + _meta: { + kroki: true, + type: 'plantuml', + }, alt: 'abc', type: 'image', url: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXMtYXNjaWkiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0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va2Utd2lkdGg6MC41OyIgd2lkdGg9IjI0IiB4PSIzOCIgeT0iNjkuMjk2OSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iODkuMjkyIj5CPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMzgsNDguMjk2OSw0OCw1Mi4yOTY5LDM4LDU2LjI5NjksNDIsNTIuMjk2OSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7c3Ryb2tlLWRhc2hhcnJheToyLjAsMi4wOyIgeDE9IjE2LjUiIHgyPSI0NCIgeTE9IjUyLjI5NjkiIHkyPSI1Mi4yOTY5Ii8+PCEtLVNSQz1bU3JKR3JSTEpTMDgwXS0tPjwvZz48L3N2Zz4=)' ## alias -> Snapshot 1 +> input `␊ \`\`\`plantuml type=mermaid alt=abc␊ @@ -108,7 +112,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -119,12 +123,16 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { children: [ { + _meta: { + kroki: true, + type: 'plantuml', + }, alt: 'abc', type: 'image', url: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXMtYXNjaWkiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0ZXh0L2NzcyIgaGVp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Igd2lkdGg9IjI0IiB4PSIzOCIgeT0iNjkuMjk2OSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iODkuMjkyIj5CPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMzgsNDguMjk2OSw0OCw1Mi4yOTY5LDM4LDU2LjI5NjksNDIsNTIuMjk2OSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7c3Ryb2tlLWRhc2hhcnJheToyLjAsMi4wOyIgeDE9IjE2LjUiIHgyPSI0NCIgeTE9IjUyLjI5NjkiIHkyPSI1Mi4yOTY5Ii8+PCEtLVNSQz1bU3JKR3JSTEpTMDgwXS0tPjwvZz48L3N2Zz4=)' diff --git a/test/snapshots/base.mjs.snap b/test/snapshots/base.mjs.snap index e691882c2be5e1133ca3110b4515cedc5d9d62f5..2803669225f0078360cb51d6fa8f7be9a300efd2 100644 GIT binary patch literal 1964 zcmV;d2UGY#RzV zM2Uvsy?mGtkrXYGqR1jm4EP762;j~JQl?0gq)L%42-2iV+LT7h{D7QGQIFBijvwP< z6L5e7-Yed7_}%lqcRv3}vgY#4`{fs^Z}^s~sc9+PL z@H_+hInb-bE02i6#bSXXg4m2sPEK;fy&Q3rBkmK#duv7*{Q^G;ETix{82$n1pFsZs zdYwpRz0#9RRrZOa?eO8lhY1S>OU{8rpih8)bI6jv%JLvb+{qCqu;%DBA`fbKMBIUW zYMV(RQNZB}TlG;g$v-%Jg;lkk$a6(KSWs9ZE7+{a-5LN)9$c}`?eMJ4DkCp5>i?Tj zKXTE+QQ&9`m3oJj)Ey{d`u1PKLT=~L}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95RE2fcb5#v z)jZeL@IkD1z|QTy97rKCzA!wT-SsTTLgWlDd zb|dA48A(|X6TMXcF|ub*76)4`Bw=m?rW_krFMb=<>axh=a%Y~<_IQU^j{w}**GPXl-BPs^_rIN_vR8I<& zUecs2_KI=FDQ^RR&va!`n`_8NJ03&zk#DFan~$B{_-p6}n2I@k!)B0Oksb(p{zQJ& zdXt9MZh5k}3PB&6=|J890k4N*pB5!k5#3Nn{wA)LYFf*r=^&86Hxk6L)~;ppG;ni& zLEJ-*ETuX>ABy~E+LVQy7-VYi3UZqCL1vyeLa_#Tklh-2-sHYUIEPEf!5YNzqoI(* zIlfNgLiHy0K2Ba3fGuYT=Uft9U+xc4oFuzA86deSo$EUwcViaU#TCloO-!CsSsuG! z%Uzrnd2$YMRzoqc%Nr^yFxQaJ;R$}*i^V?g>ir?u#tjv)JC&{N$+Wlj@@8T!P>>IN z)>M2ZLi>a)LfrSHSn-E2ch99f7l!cL3ie11m%CSv>`yWjFR-7$egL_Ma3TA2i#6~L z#ZaF20#*3gAdyYLzOSo2@xq=N*Ivf}yUv|FR(83=Bt>j)?Id|u5#T4$x1m;K^ptf~ z&-J#kJ7ohM)egIhz7fJc?rS}>CG~=uS|1|&Co>WD&b&q-zwyj^4Z_t;3S2nKzh`38 z{+8I%cJ}w9*UqL~C&!mkHrc*zH*y~*0=3&~|F=DLwXRcNyWZsdFQ_*usyBdpuikWtbxh>7 z5NF$)S~yM*YT;Jj99z2^(Gzww%xcQGKKPig4@N>a5SWgUOhX|K3}e(M{%f&MknUxEH}%NyvsFS`5Rzl47K zc`BB7(B&O;d0Z)vE9G&eJg$_-mGZb!9#_iaN_ku<@1V=3u59Ycrmk%2%BHSt>dL0B VZ0gFU?yKHGe+i;&J-IkB001;zv>pHe diff --git a/test/snapshots/fail.mjs.md b/test/snapshots/fail.mjs.md index a718749..10e4265 100644 --- a/test/snapshots/fail.mjs.md +++ b/test/snapshots/fail.mjs.md @@ -6,7 +6,7 @@ Generated by [AVA](https://avajs.dev). ## input -> Snapshot 1 +> input `␊ \`\`\`kroki type=plantuml alt=00␊ @@ -14,7 +14,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -25,12 +25,16 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { children: [ { + _meta: { + kroki: true, + type: 'plantuml', + }, alt: '00', type: 'image', url: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MDAgMTgwIj4KICA8cGF0aAogICAgZmlsbD0iI2FhYSIKICAgIGQ9Ik05Mi4xNyAzOS43NWMtLjE4LjIxIDAgLjk5Ljk3IDQuMTEuNzcgMi41Ljk1IDMuNy42OCA0LjY2LS4yMy44Mi0uNjEgMS4xOC0xLjYgMS40OS0uNDIuMTMtLjg2LjI4LS45OC4zMi0uMTIuMDQtLjM3LjAxLS41NS0uMDYtLjU5LS4yNC0xLjcxLTIuMTUtMi41Mi00LjMxLTEuNjMtNC4zNS0zLjc2LTE0LjQyLTUuNy0yNi45LS42MS0zLjk0LS43My01Ljc2LS40Ni02LjcxLjIyLS43OC45MS0xLjY2IDEuNTEtMS45Ny45OC0uNSAxLjM3LS41IDIuMzYtLjAzLjQ3LjIyNi43ODYuMzQzIDEuMDAyLjU2Mi40NDkuNDU1LjQ1NiAxLjM0Ni40OCA0LjU2NWwuMDA4Ljk2M2MuMDMgMy42My4xMiA1LjYuMyA3LjA1LjQxIDMuMTQuNTkgNC4wMi44NyA0LjA4LjE1LjAyLjc4LS42IDEuNjktMS42NyAxLjg3LTIuMjIgNS4wNC01LjI4IDYuNDMtNi4yIDEuODMtMS4yMyAyLjg2LTEuNjMgNC4xMi0xLjY0LjgzIDAgMS4yNS4wOCAxLjc5LjM1LjkzLjQ2IDEuMTYuOTUuOTkgMi4wN2wtLjEzLjg2LTIuMjcgMi4wNWMtMy43NSAzLjM5LTcuMTIgN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1LTEuMjYtMS44LjAzLTUuNzcgMi44OS04LjQ2IDYuMDlaIgogIC8+CiAgPHRleHQgeT0iODAiIGZpbGw9IiNhYWEiIGZvbnQtc2l6ZT0iMTQiPkZhaWwsIHBsZWFzZSBjaGVjayB5b3VyIGlucHV0LjwvdGV4dD4KICA8Zm9yZWlnbk9iamVjdCB3aWR0aD0iNjAwIiBoZWlnaHQ9IjgwIiB5PSI5MCIgZm9udC1zaXplPSIxNCI+CiAgICA8ZGl2CiAgICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIgogICAgICBzdHlsZT0iY29sb3I6I2ZmMjIwMDt3b3JkLWJyZWFrOmJyZWFrLWFsbCIKICAgID4KICAgICAgRXJyb3IgNDAwOiBTeW50YXggRXJyb3I/IChsaW5lOiAxKQogICAgPC9kaXY+CiAgPC9mb3JlaWduT2JqZWN0Pgo8L3N2Zz4K)' ## 404 -> Snapshot 1 +> input `␊ \`\`\`kroki type=fake␊ @@ -54,7 +58,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -65,12 +69,16 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { children: [ { + _meta: { + kroki: true, + type: 'fake', + }, alt: 'fake', type: 'image', url: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MDAgMTgwIj4KICA8cGF0aAogICAgZmlsbD0iI2FhYSIKICAgIGQ9Ik05Mi4xNyAzOS43NWMtLjE4LjIxIDAgLjk5Ljk3IDQuMTEuNzcgMi41Ljk1IDMuNy42OCA0LjY2LS4yMy44Mi0uNjEgMS4xOC0xLjYgMS40OS0uNDIuMTMtLjg2LjI4LS45OC4zMi0uMTIuMDQtLjM3LjAxLS41NS0uMDYtLjU5LS4yNC0xLjcxLTIuMTUtMi41Mi00LjMxLTEuNjMtNC4zNS0zLjc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IDMuNiA1LjcyIDMuNDIgOS4wNy0uMSAxLjkxLS4zOSAzLjAxLTEuMTcgNC41OC0xLjcxIDMuNDItNC41NyA2LjIxLTguMDkgNy45LTIuMzEgMS4xMS01LjA1IDEuNTktNy4yNiAxLjI4LTMuNzItLjUxLTYuMTctMy4wNi02Ljk4LTcuMjMtLjI5LTEuNTEtLjI3LTQuNDUuMDMtNS44MVptNy4xMS0uMWMtMS41NSAxLjg0LTEuOSAyLjU3LTEuOSAzLjkgMCAyLjA3Ljc4IDMuMjIgMi40OSAzLjY3Ljc3LjIgMi42Ni4wNCAzLjU0LS4zMiAxLjI2LS40OSAyLjQtMS4zMSAzLjczLTIuNjQgMS4zMy0xLjM1IDIuMDQtMi40MyAyLjYtMy45Ny42Ny0xLjg0LjYxLTMuOTctLjE1LTUuNDctLjQ1LS45Mi0uOTgtMS4yNy0xLjg1LTEuMjYtMS44LjAzLTUuNzcgMi44OS04LjQ2IDYuMDlaIgogIC8+CiAgPHRleHQgeT0iODAiIGZpbGw9IiNhYWEiIGZvbnQtc2l6ZT0iMTQiPkZhaWwsIHBsZWFzZSBjaGVjayB5b3VyIGlucHV0LjwvdGV4dD4KICA8Zm9yZWlnbk9iamVjdCB3aWR0aD0iNjAwIiBoZWlnaHQ9IjgwIiB5PSI5MCIgZm9udC1zaXplPSIxNCI+CiAgICA8ZGl2CiAgICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIgogICAgICBzdHlsZT0iY29sb3I6I2ZmMjIwMDt3b3JkLWJyZWFrOmJyZWFrLWFsbCIKICAgID4KICAgICAgRXJyb3IgNDA0OiBOb3QgRm91bmQKICAgIDwvZGl2PgogIDwvZm9yZWlnbk9iamVjdD4KPC9zdmc+Cg==)' ## timeout -> Snapshot 1 +> input `␊ \`\`\`kroki type=plantuml alt="0 0"␊ @@ -94,7 +102,7 @@ Generated by [AVA](https://avajs.dev). \`\`\`␊ ` -> Snapshot 2 +> ast [ { @@ -105,7 +113,7 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { @@ -116,7 +124,7 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 4 +> result `\`\`\`kroki type=plantuml alt="0 0"␊ ss␊ diff --git a/test/snapshots/fail.mjs.snap b/test/snapshots/fail.mjs.snap index a61a250e9b816060a88557d76302bcff433ca3d4..08153eea4ef60be533c3a52aaa2c44abcba2498f 100644 GIT binary patch literal 3204 zcmZw5c{~#g;{fnVBZ;1pBgUkV4m|B~XCC!L?j*V9%9&%1Y3`$D3E8kBnXOufFynEK za`w9KG4~xa78^5Tjra5U{rh{re|}9Knkd=Byu#oCp^-`m@JXQ~?#*!6@Dd|RuyttoUK^ z5~xR_T*Nk~kgbDg2lxBsoV4pOH>$zrdo5Z$@-SKK%$5|1rGx&ywdf?8CZs0uLP+<@ z0pQ9k-N=73-zF+!+~P&7N)V90zMEhS+1$nxN(FuVwyy9u{fXQby^PAPXdtMtw=x=W z4%aJzshk)vmd$*2O;4+A6i;3t{Odk-uMxieeRtN<7DMI1atSX%IICyGU`XM#xax$E z!*~4xua-XcC0VqZ^8KHj*Yfmd?)PZ3ADZM8G}Q+}F0a!VkF&0JuQ6#PSM6m#YrDYi zv2)92C8;zFV-tt=7-C;gICK(?E(2S&dwnh~B+ND@G<=RHeuk3OYXkZwd%Cr6c;2Si z?3Gw;%TcnzHXefN?RtX_{NSO?C$D$xZ2!Yy(Ar%L*U2wnK@1L@y4ysZ;@MF+6 z)jXz=yD0o&OURweWnPPg>lgkGlkIKaeOZf$f`(*;o^P9tP?Qb?GMQh!wt1x_495<( zW&^{csH|S|QWSOknkiMQCQ4WhiL~=BGAlqlx?|Hej8hft5K)D)o8#i^iFJZ|;-yP3 z`iU)(H{^9j$7za++})6A3^OE@YU4mn%luT}ddGima0ZX9#^w&$Fh5yuO_~P|zn`)W z-QbZZt|@0oWNLN&Oymj-7Et*7Qw_F}Hme(KcwA&zp9-(8v>hwZ z>1t8THjR_zyqtI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eFP6KjZLVH#Y_ z?)whbpfo%kge1|%5PgM!to-rQZtT^SnIK+qIGuscg=}ci19Sr{8~t(+J8*31-kbT* zfEC60TAiRe0wy!$UL3gvkdAR*g+z73yE<9Kv>kPb_XFe}iu{zW9b63a-)=I0RxPa)Z`hh|y-y{G~ zEgO0?UDQV;P6e-Xe|bU&X48M`Pl&rTN_qI_t;c Snapshot 1 +> input `␊ - \`\`\`kroki type=plantuml␊ - A --> B␊ - \`\`\`␊ - ` + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` -> Snapshot 2 +> ast [ { @@ -25,30 +25,89 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { type: 'html', - value: '
AABB
', + value: '

AABB

', }, ] -> Snapshot 4 +> result - '
AABB
' + '

AABB

' + +## inline-svg | mdx3 + +> input + + `␊ + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` + +> ast + + [ + { + lang: 'kroki', + meta: 'type=plantuml', + type: 'code', + value: ' A --> B', + }, + ] + +> parsed + + [ + { + attributes: [ + { + name: 'class', + type: 'mdxJsxAttribute', + value: 'kroki-inline-svg', + }, + { + name: 'data-type', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + { + name: 'data-alt', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + ], + children: [ + { + type: 'html', + value: 'AABB', + }, + ], + name: 'p', + type: 'mdxJsxFlowElement', + }, + ] + +> result + + `

␊ + AABB␊ +

` ## img-base64 -> Snapshot 1 +> input `␊ - \`\`\`kroki type=plantuml␊ - A --> B␊ - \`\`\`␊ - ` + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` -> Snapshot 2 +> ast [ { @@ -59,12 +118,16 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { children: [ { + _meta: { + kroki: true, + type: 'plantuml', + }, alt: 'plantuml', type: 'image', url: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvb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GhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iMjQuOTk1MSI+QjwvdGV4dD48cmVjdCBmaWxsPSIjRTJFMkYwIiBoZWlnaHQ9IjMwLjI5NjkiIHJ4PSIyLjUiIHJ5PSIyLjUiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjI0IiB4PSIzOCIgeT0iNjkuMjk2OSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iODkuMjkyIj5CPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMzgsNDguMjk2OSw0OCw1Mi4yOTY5LDM4LDU2LjI5NjksNDIsNTIuMjk2OSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7c3Ryb2tlLWRhc2hhcnJheToyLjAsMi4wOyIgeDE9IjE2LjUiIHgyPSI0NCIgeTE9IjUyLjI5NjkiIHkyPSI1Mi4yOTY5Ii8+PCEtLVNSQz1bU3JKR3JSTEpTMDgwXS0tPjwvZz48L3N2Zz4=)' -## img-html-base64 +## img-html-base64 | html -> Snapshot 1 +> input `␊ - \`\`\`kroki type=plantuml␊ - A --> B␊ - \`\`\`␊ - ` + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` -> Snapshot 2 +> ast [ { @@ -99,30 +162,35 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed [ { - type: 'html', - value: 'plantuml', + children: [ + { + type: 'html', + value: 'plantuml', + }, + ], + type: 'paragraph', }, ] -> Snapshot 4 +> result - 'plantuml' + 'plantuml' -## object-base64 +## img-html-base64 | mdx3 -> Snapshot 1 +> input `␊ - \`\`\`kroki type=plantuml␊ - A --> B␊ - \`\`\`␊ - ` + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` -> Snapshot 2 +> ast [ { @@ -133,7 +201,68 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 3 +> parsed + + [ + { + children: [ + { + attributes: [ + { + name: 'class', + type: 'mdxJsxAttribute', + value: 'kroki-image', + }, + { + name: 'alt', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + { + name: 'data-type', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + { + name: 'src', + type: 'mdxJsxAttribute', + value: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXMtYXNjaWkiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0ZXh0L2NzcyIgaGVpZ2h0PSIxMDVweCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSIgc3R5bGU9IndpZHRoOjY4cHg7aGVpZ2h0OjEwNXB4O2JhY2tncm91bmQ6I0ZGRkZGRjsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDY4IDEwNSIgd2lkdGg9IjY4cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTtzdHJva2UtZGFzaGFycmF5OjUuMCw1LjA7IiB4MT0iMTYiIHgyPSIxNiIgeTE9IjM2LjI5NjkiIHkyPSI3MC4yOTY5Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9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NpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iMjQuOTk1MSI+QjwvdGV4dD48cmVjdCBmaWxsPSIjRTJFMkYwIiBoZWlnaHQ9IjMwLjI5NjkiIHJ4PSIyLjUiIHJ5PSIyLjUiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjI0IiB4PSIzOCIgeT0iNjkuMjk2OSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iODkuMjkyIj5CPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMzgsNDguMjk2OSw0OCw1Mi4yOTY5LDM4LDU2LjI5NjksNDIsNTIuMjk2OSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7c3Ryb2tlLWRhc2hhcnJheToyLjAsMi4wOyIgeDE9IjE2LjUiIHgyPSI0NCIgeTE9IjUyLjI5NjkiIHkyPSI1Mi4yOTY5Ii8+PCEtLVNSQz1bU3JKR3JSTEpTMDgwXS0tPjwvZz48L3N2Zz4=', + }, + ], + name: 'img', + type: 'mdxJsxTextElement', + }, + ], + type: 'paragraph', + }, + ] + +> result + + 'plantuml' + +## object-base64 | html + +> input + + `␊ + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` + +> ast + + [ + { + lang: 'kroki', + meta: 'type=plantuml', + type: 'code', + value: ' A --> B', + }, + ] + +> parsed [ { @@ -142,6 +271,75 @@ Generated by [AVA](https://avajs.dev). }, ] -> Snapshot 4 +> result 'Load SVG fail...' + +## object-base64 | mdx3 + +> input + + `␊ + \`\`\`kroki type=plantuml␊ + A --> B␊ + \`\`\`␊ + ` + +> ast + + [ + { + lang: 'kroki', + meta: 'type=plantuml', + type: 'code', + value: ' A --> B', + }, + ] + +> parsed + + [ + { + attributes: [ + { + name: 'type', + type: 'mdxJsxAttribute', + value: 'image/svg+xml', + }, + { + name: 'class', + type: 'mdxJsxAttribute', + value: 'kroki-object', + }, + { + name: 'data-type', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + { + name: 'title', + type: 'mdxJsxAttribute', + value: 'plantuml', + }, + { + name: 'data', + type: 'mdxJsxAttribute', + value: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXMtYXNjaWkiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U3R5bGVUeXBlPSJ0ZXh0L2NzcyIgaGVpZ2h0PSIxMDVweCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSIgc3R5bGU9IndpZHRoOjY4cHg7aGVpZ2h0OjEwNXB4O2JhY2tncm91bmQ6I0ZGRkZGRjsiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDY4IDEwNSIgd2lkdGg9IjY4cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiMxODE4MTg7c3Ryb2tlLXdpZHRoOjAuNTtzdHJva2UtZGFzaGFycmF5OjUuMCw1LjA7IiB4MT0iMTYiIHgyPSIxNiIgeTE9IjM2LjI5NjkiIHkyPSI3MC4yOTY5Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDowLjU7c3Ryb2tlLWRhc2hhcnJheTo1LjAsNS4wOyIgeDE9IjUwIiB4Mj0iNTAiIHk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PSIjRTJFMkYwIiBoZWlnaHQ9IjMwLjI5NjkiIHJ4PSIyLjUiIHJ5PSIyLjUiIHN0eWxlPSJzdHJva2U6IzE4MTgxODtzdHJva2Utd2lkdGg6MC41OyIgd2lkdGg9IjI0IiB4PSIzOCIgeT0iNjkuMjk2OSIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBsZW5ndGhBZGp1c3Q9InNwYWNpbmciIHRleHRMZW5ndGg9IjEwIiB4PSI0NSIgeT0iODkuMjkyIj5CPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiMxODE4MTgiIHBvaW50cz0iMzgsNDguMjk2OSw0OCw1Mi4yOTY5LDM4LDU2LjI5NjksNDIsNTIuMjk2OSIgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTojMTgxODE4O3N0cm9rZS13aWR0aDoxLjA7c3Ryb2tlLWRhc2hhcnJheToyLjAsMi4wOyIgeDE9IjE2LjUiIHgyPSI0NCIgeTE9IjUyLjI5NjkiIHkyPSI1Mi4yOTY5Ii8+PCEtLVNSQz1bU3JKR3JSTEpTMDgwXS0tPjwvZz48L3N2Zz4=', + }, + ], + children: [ + { + type: 'text', + value: 'Load SVG fail...', + }, + ], + name: 'object', + type: 'mdxJsxFlowElement', + }, + ] + +> result + + `␊ + Load SVG fail...␊ + ` diff --git a/test/snapshots/output.mjs.snap b/test/snapshots/output.mjs.snap index 7d478c53c2d4e1f6586f72f1023127728035aefc..517977fdfcbcb4361bc9ba49067230d24fb1c1f8 100644 GIT binary patch literal 3492 zcmV;V4O{X-RzVr00000000B+9b0T8SJe|IyPKrD*)1TD;A83{MAc0)9(%HJHi;C+iDTD~ z#CGC%N+0uzJ@&ln89!ACAt5S(s02a+@q?(u7mtq$p@PKw1MvY8g^!AdKt=rVgAn4Q zmEhd5$B#+kW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F351TE~#;K|JBsYjU^26}yeIG+?hQa;^PgYwB_pr+#$2N!ou$yope}0o+&O zO_N^vL=p=rzMjUyv*<=F+~}KNt2cx0IX^g!^U_(N^SgebGZ;3#A=l8t@qh|Wz;973 z?-n4Bii?Nq#ChlIYiEJ~*!k>>G%bAn8=TqU%noOEIJ3i<9nS1~6{I ze!D(~cF{33`s*ru7Ja8@(NF&L0sV2^zjqG6O>X@1A7%U*^7?Q0Nq;6EX7G*x?+EaY z0PhI!jsWin@Q&c#aEW&Wct>!{jvzzk(!c%O`R}#!UY!2n^bejOFw&OJF;Imyc6nQQ5O=K5A)CHNixB9=JZ&How0 zdkDOTznP9t#|iPOmYmqz{%rQ8&b7gPWM3b5;w diff --git a/test/snapshots/validate.mjs.md b/test/snapshots/validate.mjs.md index 99682bf..a36d03a 100644 --- a/test/snapshots/validate.mjs.md +++ b/test/snapshots/validate.mjs.md @@ -81,13 +81,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 TypeError { - message: '`output` should be string', + message: '`output` should be one of `img-base64/object-base64/img-html-base64/inline-svg`', } > Snapshot 2 TypeError { - message: '`output` should be string', + message: '`output` should be one of `img-base64/object-base64/img-html-base64/inline-svg`', } > Snapshot 3 @@ -101,3 +101,29 @@ Generated by [AVA](https://avajs.dev). TypeError { message: '`output` should be one of `img-base64/object-base64/img-html-base64/inline-svg`', } + +## target + +> Snapshot 1 + + TypeError { + message: '`target` should be one of `html/mdx3`', + } + +> Snapshot 2 + + TypeError { + message: '`target` should be one of `html/mdx3`', + } + +> Snapshot 3 + + TypeError { + message: '`target` should be one of `html/mdx3`', + } + +> Snapshot 4 + + TypeError { + message: '`target` should be one of `html/mdx3`', + } diff --git a/test/snapshots/validate.mjs.snap b/test/snapshots/validate.mjs.snap index 992746053d8032d4e28eb49861eaa3703e500b95..65eed7e3851ee45de34baea4ffb1ca9a51dba191 100644 GIT binary patch literal 444 zcmV;t0Ym;lRzVN^3w|EfrFm_P9dfH78M8RXy^{uU@ zNlCKdP`v0o2>Ko7XYd2szq7i6cnK3)DCwh=_e)-0GaK4W3~to)9kj0*3>C;RNMCUp zDo<$jICC7T>D5EsYFhDywo&aQ8vD`RLA5qoy_kg1mr}?MS}BGIwNWE^YPDJxTC)(c z(0csQ2C7@A(MHVxl%g)=@eWDT6CC9pF$dd#m6kqtGsT?=#b$}(^87R-yqO>z%n6|s zS_}j$SUjymEMzjOtZuFc)B&l!3ip(GrzX6ZWciD07BcE{EbMC-=nC@-=Gg>hcL9?c zuoz~2mTf1X%%>%r>E48LizL~L3r3}+lO-~|nlSADFeHGuR9tWjL8vF+e~!zA$`2GV z(&0!iZlwbk*1;mA$h6)t)zk mrqYFyMtCtXsXdaWFPl{C?gh^6A*n?FQS=E+@p@9k3jhE(D9dXA literal 417 zcmV;S0bc$=RzVadmNK39l{)hjW5d!ic_L z6-#W4BtjLdwsnhQq#-K(S-6SyKDqD`-{!CGnPfEKL