Yuki Takei 3 лет назад
Родитель
Сommit
20d354bb5c

+ 11 - 11
packages/remark-growi-plugin/readme.md

@@ -137,9 +137,9 @@ function myRemarkPlugin() {
   return (tree) => {
     visit(tree, (node) => {
       if (
-        node.type === 'textDirective' ||
-        node.type === 'leafDirective' ||
-        node.type === 'containerDirective'
+        node.type === 'textGrowiPluginDirective' ||
+        node.type === 'leafGrowiPluginDirective' ||
+        node.type === 'containerGrowiPluginDirective'
       ) {
         const data = node.data || (node.data = {})
         const hast = h(node.name, node.attributes)
@@ -188,9 +188,9 @@ function myRemarkPlugin() {
   return (tree, file) => {
     visit(tree, (node) => {
       if (
-        node.type === 'textDirective' ||
-        node.type === 'leafDirective' ||
-        node.type === 'containerDirective'
+        node.type === 'textGrowiPluginDirective' ||
+        node.type === 'leafGrowiPluginDirective' ||
+        node.type === 'containerGrowiPluginDirective'
       ) {
         if (node.name !== 'youtube') return
 
@@ -198,7 +198,7 @@ function myRemarkPlugin() {
         const attributes = node.attributes || {}
         const id = attributes.id
 
-        if (node.type === 'textDirective') file.fail('Text directives for `youtube` not supported', node)
+        if (node.type === 'textGrowiPluginDirective') file.fail('Text directives for `youtube` not supported', node)
         if (!id) file.fail('Missing video id', node)
 
         data.hName = 'iframe'
@@ -247,14 +247,14 @@ function myRemarkPlugin() {
   return (tree) => {
     visit(tree, (node) => {
       if (
-        node.type === 'textDirective' ||
-        node.type === 'leafDirective' ||
-        node.type === 'containerDirective'
+        node.type === 'textGrowiPluginDirective' ||
+        node.type === 'leafGrowiPluginDirective' ||
+        node.type === 'containerGrowiPluginDirective'
       ) {
         if (node.name !== 'note') return
 
         const data = node.data || (node.data = {})
-        const tagName = node.type === 'textDirective' ? 'span' : 'div'
+        const tagName = node.type === 'textGrowiPluginDirective' ? 'span' : 'div'
 
         data.hName = tagName
         data.hProperties = h(tagName, node.attributes).properties

+ 6 - 6
packages/remark-growi-plugin/src/mdast-util-growi-plugin/complex-types.d.ts

@@ -9,27 +9,27 @@ interface DirectiveFields {
 }
 
 export interface TextDirective extends Parent, DirectiveFields {
-  type: 'textDirective'
+  type: 'textGrowiPluginDirective'
   children: PhrasingContent[]
 }
 
 export interface LeafDirective extends Parent, DirectiveFields {
-  type: 'leafDirective'
+  type: 'leafGrowiPluginDirective'
   children: PhrasingContent[]
 }
 
 export interface ContainerDirective extends Parent, DirectiveFields {
-  type: 'containerDirective'
+  type: 'containerGrowiPluginDirective'
   children: BlockContent[]
 }
 
 declare module 'mdast' {
   interface StaticPhrasingContentMap {
-    textDirective: TextDirective
+    textGrowiPluginDirective: TextDirective
   }
 
   interface BlockContentMap {
-    containerDirective: ContainerDirective
-    leafDirective: LeafDirective
+    containerGrowiPluginDirective: ContainerDirective
+    leafGrowiPluginDirective: LeafDirective
   }
 }

+ 16 - 16
packages/remark-growi-plugin/src/mdast-util-growi-plugin/index.js

@@ -31,7 +31,7 @@ handleDirective.peek = peekDirective;
 
 /** @type {FromMarkdownExtension} */
 export const directiveFromMarkdown = {
-  canContainEols: ['textDirective'],
+  canContainEols: ['textGrowiPluginDirective'],
   enter: {
     directiveContainer: enterContainer,
     directiveContainerAttributes: enterAttributes,
@@ -76,11 +76,11 @@ export const directiveToMarkdown = {
   unsafe: [
     {
       character: '\r',
-      inConstruct: ['leafDirectiveLabel', 'containerDirectiveLabel'],
+      inConstruct: ['leafGrowiPluginDirectiveLabel', 'containerGrowiPluginDirectiveLabel'],
     },
     {
       character: '\n',
-      inConstruct: ['leafDirectiveLabel', 'containerDirectiveLabel'],
+      inConstruct: ['leafGrowiPluginDirectiveLabel', 'containerGrowiPluginDirectiveLabel'],
     },
     {
       before: '[^:]',
@@ -91,25 +91,25 @@ export const directiveToMarkdown = {
     { atBreak: true, character: ':', after: ':' },
   ],
   handlers: {
-    containerDirective: handleDirective,
-    leafDirective: handleDirective,
-    textDirective: handleDirective,
+    containerGrowiPluginDirective: handleDirective,
+    leafGrowiPluginDirective: handleDirective,
+    textGrowiPluginDirective: handleDirective,
   },
 };
 
 /** @type {FromMarkdownHandle} */
 function enterContainer(token) {
-  enter.call(this, 'containerDirective', token);
+  enter.call(this, 'containerGrowiPluginDirective', token);
 }
 
 /** @type {FromMarkdownHandle} */
 function enterLeaf(token) {
-  enter.call(this, 'leafDirective', token);
+  enter.call(this, 'leafGrowiPluginDirective', token);
 }
 
 /** @type {FromMarkdownHandle} */
 function enterText(token) {
-  enter.call(this, 'textDirective', token);
+  enter.call(this, 'textGrowiPluginDirective', token);
 }
 
 /**
@@ -229,7 +229,7 @@ function handleDirective(node, _, context, safeOptions) {
   /** @type {Directive|Paragraph|undefined} */
   let label = node;
 
-  if (node.type === 'containerDirective') {
+  if (node.type === 'containerGrowiPluginDirective') {
     const head = (node.children || [])[0];
     label = inlineDirectiveLabel(head) ? head : undefined;
   }
@@ -252,7 +252,7 @@ function handleDirective(node, _, context, safeOptions) {
 
   value += tracker.move(attributes(node, context));
 
-  if (node.type === 'containerDirective') {
+  if (node.type === 'containerGrowiPluginDirective') {
     const head = (node.children || [])[0];
     let shallow = node;
 
@@ -284,7 +284,7 @@ function peekDirective() {
  */
 function attributes(node, context) {
   const quote = checkQuote(context);
-  const subset = node.type === 'textDirective' ? [quote] : [quote, '\n', '\r'];
+  const subset = node.type === 'textGrowiPluginDirective' ? [quote] : [quote, '\n', '\r'];
   const attrs = node.attributes || {};
   /** @type {Array.<string>} */
   const values = [];
@@ -380,11 +380,11 @@ function inlineDirectiveLabel(node) {
 function fence(node) {
   let size = 0;
 
-  if (node.type === 'containerDirective') {
-    visitParents(node, 'containerDirective', onvisit);
+  if (node.type === 'containerGrowiPluginDirective') {
+    visitParents(node, 'containerGrowiPluginDirective', onvisit);
     size += 3;
   }
-  else if (node.type === 'leafDirective') {
+  else if (node.type === 'leafGrowiPluginDirective') {
     size = 2;
   }
   else {
@@ -399,7 +399,7 @@ function fence(node) {
     let nesting = 0;
 
     while (index--) {
-      if (parents[index].type === 'containerDirective') {
+      if (parents[index].type === 'containerGrowiPluginDirective') {
         nesting++;
       }
     }

+ 7 - 7
packages/remark-growi-plugin/src/mdast-util-growi-plugin/readme.md

@@ -132,7 +132,7 @@ console.log(out)
       children: [
         {type: 'text', value: 'A lovely language know as '},
         {
-          type: 'textDirective',
+          type: 'textGrowiPluginDirective',
           name: 'abbr',
           attributes: {title: 'HyperText Markup Language'},
           children: [{type: 'text', value: 'HTML'}]
@@ -175,7 +175,7 @@ The following interfaces are added to **[mdast][]** by this utility.
 
 ```idl
 interface TextDirective <: Parent {
-  type: 'textDirective'
+  type: 'textGrowiPluginDirective'
   children: [PhrasingContent]
 }
 
@@ -197,7 +197,7 @@ Yields:
 
 ```js
 {
-  type: 'textDirective',
+  type: 'textGrowiPluginDirective',
   name: 'name',
   attributes: {id: 'x', class: 'y z', key: 'value'},
   children: [{type: 'text', value: 'Label'}]
@@ -208,7 +208,7 @@ Yields:
 
 ```idl
 interface LeafDirective <: Parent {
-  type: 'leafDirective'
+  type: 'leafGrowiPluginDirective'
   children: [PhrasingContent]
 }
 
@@ -230,7 +230,7 @@ Yields:
 
 ```js
 {
-  type: 'leafDirective',
+  type: 'leafGrowiPluginDirective',
   name: 'youtube',
   attributes: {v: '123'},
   children: [{type: 'text', value: 'Label'}]
@@ -241,7 +241,7 @@ Yields:
 
 ```idl
 interface ContainerDirective <: Parent {
-  type: 'containerDirective'
+  type: 'containerGrowiPluginDirective'
   children: [FlowContent]
 }
 
@@ -268,7 +268,7 @@ Yields:
 
 ```js
 {
-  type: 'containerDirective',
+  type: 'containerGrowiPluginDirective',
   name: 'spoiler',
   attributes: {},
   children: [

+ 379 - 374
packages/remark-growi-plugin/src/mdast-util-growi-plugin/test.js

@@ -1,15 +1,16 @@
-import test from 'tape'
-import {fromMarkdown} from 'mdast-util-from-markdown'
-import {toMarkdown} from 'mdast-util-to-markdown'
-import {removePosition} from 'unist-util-remove-position'
-import {directive} from 'micromark-extension-directive'
-import {directiveFromMarkdown, directiveToMarkdown} from './index.js'
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { toMarkdown } from 'mdast-util-to-markdown';
+import { directive } from 'micromark-extension-directive';
+import test from 'tape';
+import { removePosition } from 'unist-util-remove-position';
+
+import { directiveFromMarkdown, directiveToMarkdown } from './index.js';
 
 test('markdown -> mdast', (t) => {
   t.deepEqual(
     fromMarkdown('a :b[c]{d} e.', {
       extensions: [directive()],
-      mdastExtensions: [directiveFromMarkdown]
+      mdastExtensions: [directiveFromMarkdown],
     }).children[0],
     {
       type: 'paragraph',
@@ -18,100 +19,100 @@ test('markdown -> mdast', (t) => {
           type: 'text',
           value: 'a ',
           position: {
-            start: {line: 1, column: 1, offset: 0},
-            end: {line: 1, column: 3, offset: 2}
-          }
+            start: { line: 1, column: 1, offset: 0 },
+            end: { line: 1, column: 3, offset: 2 },
+          },
         },
         {
-          type: 'textDirective',
+          type: 'textGrowiPluginDirective',
           name: 'b',
-          attributes: {d: ''},
+          attributes: { d: '' },
           children: [
             {
               type: 'text',
               value: 'c',
               position: {
-                start: {line: 1, column: 6, offset: 5},
-                end: {line: 1, column: 7, offset: 6}
-              }
-            }
+                start: { line: 1, column: 6, offset: 5 },
+                end: { line: 1, column: 7, offset: 6 },
+              },
+            },
           ],
           position: {
-            start: {line: 1, column: 3, offset: 2},
-            end: {line: 1, column: 11, offset: 10}
-          }
+            start: { line: 1, column: 3, offset: 2 },
+            end: { line: 1, column: 11, offset: 10 },
+          },
         },
         {
           type: 'text',
           value: ' e.',
           position: {
-            start: {line: 1, column: 11, offset: 10},
-            end: {line: 1, column: 14, offset: 13}
-          }
-        }
+            start: { line: 1, column: 11, offset: 10 },
+            end: { line: 1, column: 14, offset: 13 },
+          },
+        },
       ],
       position: {
-        start: {line: 1, column: 1, offset: 0},
-        end: {line: 1, column: 14, offset: 13}
-      }
+        start: { line: 1, column: 1, offset: 0 },
+        end: { line: 1, column: 14, offset: 13 },
+      },
     },
-    'should support directives (text)'
-  )
+    'should support directives (text)',
+  );
 
   t.deepEqual(
     fromMarkdown('::a[b]{c}', {
       extensions: [directive()],
-      mdastExtensions: [directiveFromMarkdown]
+      mdastExtensions: [directiveFromMarkdown],
     }).children[0],
     {
-      type: 'leafDirective',
+      type: 'leafGrowiPluginDirective',
       name: 'a',
-      attributes: {c: ''},
+      attributes: { c: '' },
       children: [
         {
           type: 'text',
           value: 'b',
           position: {
-            start: {line: 1, column: 5, offset: 4},
-            end: {line: 1, column: 6, offset: 5}
-          }
-        }
+            start: { line: 1, column: 5, offset: 4 },
+            end: { line: 1, column: 6, offset: 5 },
+          },
+        },
       ],
       position: {
-        start: {line: 1, column: 1, offset: 0},
-        end: {line: 1, column: 10, offset: 9}
-      }
+        start: { line: 1, column: 1, offset: 0 },
+        end: { line: 1, column: 10, offset: 9 },
+      },
     },
-    'should support directives (leaf)'
-  )
+    'should support directives (leaf)',
+  );
 
   t.deepEqual(
     fromMarkdown(':::a[b]{c}\nd', {
       extensions: [directive()],
-      mdastExtensions: [directiveFromMarkdown]
+      mdastExtensions: [directiveFromMarkdown],
     }).children[0],
     {
-      type: 'containerDirective',
+      type: 'containerGrowiPluginDirective',
       name: 'a',
-      attributes: {c: ''},
+      attributes: { c: '' },
       children: [
         {
           type: 'paragraph',
-          data: {directiveLabel: true},
+          data: { directiveLabel: true },
           children: [
             {
               type: 'text',
               value: 'b',
               position: {
-                start: {line: 1, column: 6, offset: 5},
-                end: {line: 1, column: 7, offset: 6}
-              }
-            }
+                start: { line: 1, column: 6, offset: 5 },
+                end: { line: 1, column: 7, offset: 6 },
+              },
+            },
           ],
           position: {
-            start: {line: 1, column: 5, offset: 4},
-            end: {line: 1, column: 8, offset: 7}
-          }
+            start: { line: 1, column: 5, offset: 4 },
+            end: { line: 1, column: 8, offset: 7 },
+          },
         },
         {
           type: 'paragraph',
@@ -120,32 +121,32 @@ test('markdown -> mdast', (t) => {
               type: 'text',
               value: 'd',
               position: {
-                start: {line: 2, column: 1, offset: 11},
-                end: {line: 2, column: 2, offset: 12}
-              }
-            }
+                start: { line: 2, column: 1, offset: 11 },
+                end: { line: 2, column: 2, offset: 12 },
+              },
+            },
           ],
           position: {
-            start: {line: 2, column: 1, offset: 11},
-            end: {line: 2, column: 2, offset: 12}
-          }
-        }
+            start: { line: 2, column: 1, offset: 11 },
+            end: { line: 2, column: 2, offset: 12 },
+          },
+        },
       ],
       position: {
-        start: {line: 1, column: 1, offset: 0},
-        end: {line: 2, column: 2, offset: 12}
-      }
+        start: { line: 1, column: 1, offset: 0 },
+        end: { line: 2, column: 2, offset: 12 },
+      },
     },
-    'should support directives (container)'
-  )
+    'should support directives (container)',
+  );
 
   t.deepEqual(
     removePosition(
       fromMarkdown(':a[b *c*\nd]', {
         extensions: [directive()],
-        mdastExtensions: [directiveFromMarkdown]
+        mdastExtensions: [directiveFromMarkdown],
       }),
-      true
+      true,
     ),
     {
       type: 'root',
@@ -154,29 +155,29 @@ test('markdown -> mdast', (t) => {
           type: 'paragraph',
           children: [
             {
-              type: 'textDirective',
+              type: 'textGrowiPluginDirective',
               name: 'a',
               attributes: {},
               children: [
-                {type: 'text', value: 'b '},
-                {type: 'emphasis', children: [{type: 'text', value: 'c'}]},
-                {type: 'text', value: '\nd'}
-              ]
-            }
-          ]
-        }
-      ]
+                { type: 'text', value: 'b ' },
+                { type: 'emphasis', children: [{ type: 'text', value: 'c' }] },
+                { type: 'text', value: '\nd' },
+              ],
+            },
+          ],
+        },
+      ],
     },
-    'should support content in a label'
-  )
+    'should support content in a label',
+  );
 
   t.deepEqual(
     removePosition(
       fromMarkdown(':a{#b.c.d e=f g="h&amp;i&unknown;j"}', {
         extensions: [directive()],
-        mdastExtensions: [directiveFromMarkdown]
+        mdastExtensions: [directiveFromMarkdown],
       }),
-      true
+      true,
     ),
     {
       type: 'root',
@@ -185,25 +186,27 @@ test('markdown -> mdast', (t) => {
           type: 'paragraph',
           children: [
             {
-              type: 'textDirective',
+              type: 'textGrowiPluginDirective',
               name: 'a',
-              attributes: {id: 'b', class: 'c d', e: 'f', g: 'h&i&unknown;j'},
-              children: []
-            }
-          ]
-        }
-      ]
+              attributes: {
+                id: 'b', class: 'c d', e: 'f', g: 'h&i&unknown;j',
+              },
+              children: [],
+            },
+          ],
+        },
+      ],
     },
-    'should support attributes'
-  )
+    'should support attributes',
+  );
 
   t.deepEqual(
     removePosition(
       fromMarkdown(':a{b\nc="d\ne"}', {
         extensions: [directive()],
-        mdastExtensions: [directiveFromMarkdown]
+        mdastExtensions: [directiveFromMarkdown],
       }),
-      true
+      true,
     ),
     {
       type: 'root',
@@ -212,36 +215,36 @@ test('markdown -> mdast', (t) => {
           type: 'paragraph',
           children: [
             {
-              type: 'textDirective',
+              type: 'textGrowiPluginDirective',
               name: 'a',
-              attributes: {b: '', c: 'd\ne'},
-              children: []
-            }
-          ]
-        }
-      ]
+              attributes: { b: '', c: 'd\ne' },
+              children: [],
+            },
+          ],
+        },
+      ],
     },
-    'should support EOLs in attributes'
-  )
+    'should support EOLs in attributes',
+  );
 
   t.deepEqual(
     removePosition(
       fromMarkdown('::::a\n:::b\n:c\n:::\n::::', {
         extensions: [directive()],
-        mdastExtensions: [directiveFromMarkdown]
+        mdastExtensions: [directiveFromMarkdown],
       }),
-      true
+      true,
     ),
     {
       type: 'root',
       children: [
         {
-          type: 'containerDirective',
+          type: 'containerGrowiPluginDirective',
           name: 'a',
           attributes: {},
           children: [
             {
-              type: 'containerDirective',
+              type: 'containerGrowiPluginDirective',
               name: 'b',
               attributes: {},
               children: [
@@ -249,24 +252,24 @@ test('markdown -> mdast', (t) => {
                   type: 'paragraph',
                   children: [
                     {
-                      type: 'textDirective',
+                      type: 'textGrowiPluginDirective',
                       name: 'c',
                       attributes: {},
-                      children: []
-                    }
-                  ]
-                }
-              ]
-            }
-          ]
-        }
-      ]
+                      children: [],
+                    },
+                  ],
+                },
+              ],
+            },
+          ],
+        },
+      ],
     },
-    'should support directives in directives'
-  )
+    'should support directives in directives',
+  );
 
-  t.end()
-})
+  t.end();
+});
 
 test('mdast -> markdown', (t) => {
   t.deepEqual(
@@ -274,636 +277,638 @@ test('mdast -> markdown', (t) => {
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           // @ts-expect-error: `children`, `name` missing.
-          {type: 'textDirective'},
-          {type: 'text', value: ' b.'}
-        ]
+          { type: 'textGrowiPluginDirective' },
+          { type: 'text', value: ' b.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a : b.\n',
-    'should try to serialize a directive (text) w/o `name`'
-  )
+    'should try to serialize a directive (text) w/o `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           // @ts-expect-error: `children` missing.
-          {type: 'textDirective', name: 'b'},
-          {type: 'text', value: ' c.'}
-        ]
+          { type: 'textGrowiPluginDirective', name: 'b' },
+          { type: 'text', value: ' c.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b c.\n',
-    'should serialize a directive (text) w/ `name`'
-  )
+    'should serialize a directive (text) w/ `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            children: [{type: 'text', value: 'c'}]
+            children: [{ type: 'text', value: 'c' }],
           },
-          {type: 'text', value: ' d.'}
-        ]
+          { type: 'text', value: ' d.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b[c] d.\n',
-    'should serialize a directive (text) w/ `children`'
-  )
+    'should serialize a directive (text) w/ `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            children: [{type: 'text', value: 'c[d]e'}]
+            children: [{ type: 'text', value: 'c[d]e' }],
           },
-          {type: 'text', value: ' f.'}
-        ]
+          { type: 'text', value: ' f.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b[c\\[d\\]e] f.\n',
-    'should escape brackets in a directive (text) label'
-  )
+    'should escape brackets in a directive (text) label',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            children: [{type: 'text', value: 'c\nd'}]
+            children: [{ type: 'text', value: 'c\nd' }],
           },
-          {type: 'text', value: ' e.'}
-        ]
+          { type: 'text', value: ' e.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b[c\nd] e.\n',
-    'should support EOLs in a directive (text) label'
-  )
+    'should support EOLs in a directive (text) label',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
             // @ts-expect-error: should contain only `string`s
-            attributes: {c: 'd', e: 'f', g: '', h: null, i: undefined, j: 2},
-            children: []
+            attributes: {
+              c: 'd', e: 'f', g: '', h: null, i: undefined, j: 2,
+            },
+            children: [],
           },
-          {type: 'text', value: ' k.'}
-        ]
+          { type: 'text', value: ' k.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{c="d" e="f" g j="2"} k.\n',
-    'should serialize a directive (text) w/ `attributes`'
-  )
+    'should serialize a directive (text) w/ `attributes`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {class: 'a b\nc', id: 'd', key: 'value'},
-            children: []
+            attributes: { class: 'a b\nc', id: 'd', key: 'value' },
+            children: [],
           },
-          {type: 'text', value: ' k.'}
-        ]
+          { type: 'text', value: ' k.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{#d .a.b.c key="value"} k.\n',
-    'should serialize a directive (text) w/ `id`, `class` attributes'
-  )
+    'should serialize a directive (text) w/ `id`, `class` attributes',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {x: 'y"\'\r\nz'},
-            children: []
+            attributes: { x: 'y"\'\r\nz' },
+            children: [],
           },
-          {type: 'text', value: ' k.'}
-        ]
+          { type: 'text', value: ' k.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{x="y&#x22;\'\r\nz"} k.\n',
-    'should encode the quote in an attribute value (text)'
-  )
+    'should encode the quote in an attribute value (text)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {x: 'y"\'\r\nz'},
-            children: []
+            attributes: { x: 'y"\'\r\nz' },
+            children: [],
           },
-          {type: 'text', value: ' k.'}
-        ]
+          { type: 'text', value: ' k.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{x="y&#x22;\'\r\nz"} k.\n',
-    'should encode the quote in an attribute value (text)'
-  )
+    'should encode the quote in an attribute value (text)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {id: 'c#d'},
-            children: []
+            attributes: { id: 'c#d' },
+            children: [],
           },
-          {type: 'text', value: ' e.'}
-        ]
+          { type: 'text', value: ' e.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{id="c#d"} e.\n',
-    'should not use the `id` shortcut if impossible characters exist'
-  )
+    'should not use the `id` shortcut if impossible characters exist',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {class: 'c.d e<f'},
-            children: []
+            attributes: { class: 'c.d e<f' },
+            children: [],
           },
-          {type: 'text', value: ' g.'}
-        ]
+          { type: 'text', value: ' g.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{class="c.d e<f"} g.\n',
-    'should not use the `class` shortcut if impossible characters exist'
-  )
+    'should not use the `class` shortcut if impossible characters exist',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'text', value: 'a '},
+          { type: 'text', value: 'a ' },
           {
-            type: 'textDirective',
+            type: 'textGrowiPluginDirective',
             name: 'b',
-            attributes: {class: 'c.d e f<g hij'},
-            children: []
+            attributes: { class: 'c.d e f<g hij' },
+            children: [],
           },
-          {type: 'text', value: ' k.'}
-        ]
+          { type: 'text', value: ' k.' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a :b{.e.hij class="c.d f<g"} k.\n',
-    'should not use the `class` shortcut if impossible characters exist (but should use it for classes that don’t)'
-  )
+    'should not use the `class` shortcut if impossible characters exist (but should use it for classes that don’t)',
+  );
 
   t.deepEqual(
     // @ts-expect-error: `children`, `name` missing.
-    toMarkdown({type: 'leafDirective'}, {extensions: [directiveToMarkdown]}),
+    toMarkdown({ type: 'leafGrowiPluginDirective' }, { extensions: [directiveToMarkdown] }),
     '::\n',
-    'should try to serialize a directive (leaf) w/o `name`'
-  )
+    'should try to serialize a directive (leaf) w/o `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       // @ts-expect-error: `children` missing.
-      {type: 'leafDirective', name: 'a'},
-      {extensions: [directiveToMarkdown]}
+      { type: 'leafGrowiPluginDirective', name: 'a' },
+      { extensions: [directiveToMarkdown] },
     ),
     '::a\n',
-    'should serialize a directive (leaf) w/ `name`'
-  )
+    'should serialize a directive (leaf) w/ `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'leafDirective',
+        type: 'leafGrowiPluginDirective',
         name: 'a',
-        children: [{type: 'text', value: 'b'}]
+        children: [{ type: 'text', value: 'b' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::a[b]\n',
-    'should serialize a directive (leaf) w/ `children`'
-  )
+    'should serialize a directive (leaf) w/ `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'leafDirective',
+        type: 'leafGrowiPluginDirective',
         name: 'a',
-        children: [{type: 'text', value: 'b'}]
+        children: [{ type: 'text', value: 'b' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::a[b]\n',
-    'should serialize a directive (leaf) w/ `children`'
-  )
+    'should serialize a directive (leaf) w/ `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'leafDirective',
+        type: 'leafGrowiPluginDirective',
         name: 'a',
-        children: [{type: 'text', value: 'b\nc'}]
+        children: [{ type: 'text', value: 'b\nc' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::a[b&#xA;c]\n',
-    'should serialize a directive (leaf) w/ EOLs in `children`'
-  )
+    'should serialize a directive (leaf) w/ EOLs in `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'leafDirective',
+        type: 'leafGrowiPluginDirective',
         name: 'a',
-        attributes: {id: 'b', class: 'c d', key: 'e\nf'},
-        children: []
+        attributes: { id: 'b', class: 'c d', key: 'e\nf' },
+        children: [],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::a{#b .c.d key="e&#xA;f"}\n',
-    'should serialize a directive (leaf) w/ EOLs in `attributes`'
-  )
+    'should serialize a directive (leaf) w/ EOLs in `attributes`',
+  );
 
   t.deepEqual(
     toMarkdown(
       // @ts-expect-error: `children`, `name` missing.
-      {type: 'containerDirective'},
-      {extensions: [directiveToMarkdown]}
+      { type: 'containerGrowiPluginDirective' },
+      { extensions: [directiveToMarkdown] },
     ),
     ':::\n:::\n',
-    'should try to serialize a directive (container) w/o `name`'
-  )
+    'should try to serialize a directive (container) w/o `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       // @ts-expect-error: `children` missing.
-      {type: 'containerDirective', name: 'a'},
-      {extensions: [directiveToMarkdown]}
+      { type: 'containerGrowiPluginDirective', name: 'a' },
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a\n:::\n',
-    'should serialize a directive (container) w/ `name`'
-  )
+    'should serialize a directive (container) w/ `name`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
-        children: [{type: 'paragraph', children: [{type: 'text', value: 'b'}]}]
+        children: [{ type: 'paragraph', children: [{ type: 'text', value: 'b' }] }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a\nb\n:::\n',
-    'should serialize a directive (container) w/ `children`'
-  )
+    'should serialize a directive (container) w/ `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
-          {type: 'heading', depth: 1, children: [{type: 'text', value: 'b'}]}
-        ]
+          { type: 'heading', depth: 1, children: [{ type: 'text', value: 'b' }] },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a\n# b\n:::\n',
-    'should serialize a directive (container) w/ `children` (heading)'
-  )
+    'should serialize a directive (container) w/ `children` (heading)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
-          {type: 'paragraph', children: [{type: 'text', value: 'b\nc'}]}
-        ]
+          { type: 'paragraph', children: [{ type: 'text', value: 'b\nc' }] },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a\nb\nc\n:::\n',
-    'should serialize a directive (container) w/ EOLs in `children`'
-  )
+    'should serialize a directive (container) w/ EOLs in `children`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
-        attributes: {id: 'b', class: 'c d', key: 'e\nf'},
-        children: []
+        attributes: { id: 'b', class: 'c d', key: 'e\nf' },
+        children: [],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a{#b .c.d key="e&#xA;f"}\n:::\n',
-    'should serialize a directive (container) w/ EOLs in `attributes`'
-  )
+    'should serialize a directive (container) w/ EOLs in `attributes`',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
           {
             type: 'paragraph',
-            data: {directiveLabel: true},
-            children: [{type: 'text', value: 'b'}]
-          }
-        ]
+            data: { directiveLabel: true },
+            children: [{ type: 'text', value: 'b' }],
+          },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::a[b]\n:::\n',
-    'should serialize the first paragraph w/ `data.directiveLabel` as a label in a directive (container)'
-  )
+    'should serialize the first paragraph w/ `data.directiveLabel` as a label in a directive (container)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
           {
-            type: 'containerDirective',
+            type: 'containerGrowiPluginDirective',
             name: 'b',
             children: [
               {
                 type: 'paragraph',
-                children: [{type: 'text', value: 'c'}]
-              }
-            ]
-          }
-        ]
+                children: [{ type: 'text', value: 'c' }],
+              },
+            ],
+          },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::::a\n:::b\nc\n:::\n::::\n',
-    'should serialize the outer containers w/ more colons than inner containers'
-  )
+    'should serialize the outer containers w/ more colons than inner containers',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
           {
-            type: 'containerDirective',
+            type: 'containerGrowiPluginDirective',
             name: 'b',
             children: [
               {
                 type: 'paragraph',
-                children: [{type: 'text', value: 'c'}]
-              }
-            ]
+                children: [{ type: 'text', value: 'c' }],
+              },
+            ],
           },
           {
-            type: 'containerDirective',
+            type: 'containerGrowiPluginDirective',
             name: 'd',
             children: [
               {
                 type: 'paragraph',
-                children: [{type: 'text', value: 'e'}]
-              }
-            ]
-          }
-        ]
+                children: [{ type: 'text', value: 'e' }],
+              },
+            ],
+          },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::::a\n:::b\nc\n:::\n\n:::d\ne\n:::\n::::\n',
-    'should serialize w/ `3 + nesting`, not the total count (1)'
-  )
+    'should serialize w/ `3 + nesting`, not the total count (1)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
           {
-            type: 'containerDirective',
+            type: 'containerGrowiPluginDirective',
             name: 'b',
             children: [
               {
-                type: 'containerDirective',
+                type: 'containerGrowiPluginDirective',
                 name: 'c',
                 children: [
                   {
                     type: 'paragraph',
-                    children: [{type: 'text', value: 'd'}]
-                  }
-                ]
-              }
-            ]
-          }
-        ]
+                    children: [{ type: 'text', value: 'd' }],
+                  },
+                ],
+              },
+            ],
+          },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':::::a\n::::b\n:::c\nd\n:::\n::::\n:::::\n',
-    'should serialize w/ `3 + nesting`, not the total count (2)'
-  )
+    'should serialize w/ `3 + nesting`, not the total count (2)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
-        type: 'containerDirective',
+        type: 'containerGrowiPluginDirective',
         name: 'a',
         children: [
           {
             type: 'blockquote',
             children: [
               {
-                type: 'containerDirective',
+                type: 'containerGrowiPluginDirective',
                 name: 'b',
                 children: [
                   {
                     type: 'paragraph',
-                    children: [{type: 'text', value: 'c'}]
-                  }
-                ]
-              }
-            ]
-          }
-        ]
+                    children: [{ type: 'text', value: 'c' }],
+                  },
+                ],
+              },
+            ],
+          },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '::::a\n> :::b\n> c\n> :::\n::::\n',
-    'should serialize w/ `3 + nesting`, not the total count (3)'
-  )
+    'should serialize w/ `3 + nesting`, not the total count (3)',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: 'a:b'}]
+        children: [{ type: 'text', value: 'a:b' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a\\:b\n',
-    'should escape a `:` in phrasing when followed by an alpha'
-  )
+    'should escape a `:` in phrasing when followed by an alpha',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: 'a:9'}]
+        children: [{ type: 'text', value: 'a:9' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a:9\n',
-    'should not escape a `:` in phrasing when followed by a non-alpha'
-  )
+    'should not escape a `:` in phrasing when followed by a non-alpha',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: 'a::c'}]
+        children: [{ type: 'text', value: 'a::c' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     'a::c\n',
-    'should not escape a `:` in phrasing when preceded by a colon'
-  )
+    'should not escape a `:` in phrasing when preceded by a colon',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: ':\na'}]
+        children: [{ type: 'text', value: ':\na' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':\na\n',
-    'should not escape a `:` at a break'
-  )
+    'should not escape a `:` at a break',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: ':a'}]
+        children: [{ type: 'text', value: ':a' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '\\:a\n',
-    'should not escape a `:` at a break when followed by an alpha'
-  )
+    'should not escape a `:` at a break when followed by an alpha',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: '::\na'}]
+        children: [{ type: 'text', value: '::\na' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '\\::\na\n',
-    'should escape a `:` at a break when followed by a colon'
-  )
+    'should escape a `:` at a break when followed by a colon',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: ':::\na'}]
+        children: [{ type: 'text', value: ':::\na' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '\\:::\na\n',
-    'should escape a `:` at a break when followed by two colons'
-  )
+    'should escape a `:` at a break when followed by two colons',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
-        children: [{type: 'text', value: ':::\na'}]
+        children: [{ type: 'text', value: ':::\na' }],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     '\\:::\na\n',
-    'should escape a `:` at a break when followed by two colons'
-  )
+    'should escape a `:` at a break when followed by two colons',
+  );
 
   t.deepEqual(
     toMarkdown(
       {
         type: 'paragraph',
         children: [
-          {type: 'textDirective', name: 'red', children: []},
-          {type: 'text', value: ':'}
-        ]
+          { type: 'textGrowiPluginDirective', name: 'red', children: [] },
+          { type: 'text', value: ':' },
+        ],
       },
-      {extensions: [directiveToMarkdown]}
+      { extensions: [directiveToMarkdown] },
     ),
     ':red:\n',
-    'should escape a `:` after a text directive'
-  )
+    'should escape a `:` after a text directive',
+  );
 
-  t.end()
-})
+  t.end();
+});

+ 2 - 2
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/readme.md

@@ -57,7 +57,7 @@ const output = micromark(fs.readFileSync('example.md'), {
 console.log(output)
 
 function abbr(d) {
-  if (d.type !== 'textDirective') return false
+  if (d.type !== 'textGrowiPluginDirective') return false
 
   this.tag('<abbr')
 
@@ -120,7 +120,7 @@ An object representing a directive.
 
 ###### Fields
 
-*   `type` (`'textDirective'|'leafDirective'|'containerDirective'`)
+*   `type` (`'textGrowiPluginDirective'|'leafGrowiPluginDirective'|'containerGrowiPluginDirective'`)
 *   `name` (`string`) — name of directive
 *   `label` (`string?`) — compiled HTML content that was in `[brackets]`
 *   `attributes` (`Record<string, string>?`) — object w/ HTML attributes

Разница между файлами не показана из-за своего большого размера
+ 402 - 401
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/test/index.js


+ 12 - 12
packages/remark-growi-plugin/test/fixtures/container/tree.json

@@ -2,7 +2,7 @@
   "type": "root",
   "children": [
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [],
@@ -20,7 +20,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
@@ -75,7 +75,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "b": ""
@@ -95,7 +95,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "c": ""
@@ -152,7 +152,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
@@ -289,7 +289,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "id": "e",
@@ -311,17 +311,17 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
         {
-          "type": "containerDirective",
+          "type": "containerGrowiPluginDirective",
           "name": "b",
           "attributes": {},
           "children": [
             {
-              "type": "containerDirective",
+              "type": "containerGrowiPluginDirective",
               "name": "c",
               "attributes": {},
               "children": [],
@@ -367,7 +367,7 @@
       }
     },
     {
-      "type": "containerDirective",
+      "type": "containerGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
@@ -405,7 +405,7 @@
           }
         },
         {
-          "type": "containerDirective",
+          "type": "containerGrowiPluginDirective",
           "name": "c",
           "attributes": {},
           "children": [
@@ -443,7 +443,7 @@
               }
             },
             {
-              "type": "containerDirective",
+              "type": "containerGrowiPluginDirective",
               "name": "e",
               "attributes": {},
               "children": [

+ 6 - 6
packages/remark-growi-plugin/test/fixtures/leaf/tree.json

@@ -2,7 +2,7 @@
   "type": "root",
   "children": [
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [],
@@ -20,7 +20,7 @@
       }
     },
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
@@ -55,7 +55,7 @@
       }
     },
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "b": ""
@@ -75,7 +75,7 @@
       }
     },
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "c": ""
@@ -112,7 +112,7 @@
       }
     },
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {},
       "children": [
@@ -229,7 +229,7 @@
       }
     },
     {
-      "type": "leafDirective",
+      "type": "leafGrowiPluginDirective",
       "name": "a",
       "attributes": {
         "id": "e",

+ 6 - 6
packages/remark-growi-plugin/test/fixtures/text/tree.json

@@ -21,7 +21,7 @@
           }
         },
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {},
           "children": [],
@@ -55,7 +55,7 @@
           }
         },
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {},
           "children": [
@@ -106,7 +106,7 @@
           }
         },
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {
             "b": ""
@@ -142,7 +142,7 @@
           }
         },
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {
             "c": ""
@@ -212,7 +212,7 @@
       "type": "paragraph",
       "children": [
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {},
           "children": [
@@ -362,7 +362,7 @@
       "type": "paragraph",
       "children": [
         {
-          "type": "textDirective",
+          "type": "textGrowiPluginDirective",
           "name": "a",
           "attributes": {
             "id": "e",

Некоторые файлы не были показаны из-за большого количества измененных файлов