Skip to content

Commit

Permalink
fix(directive): bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Nov 10, 2023
1 parent 582c6b1 commit e9cc2ef
Show file tree
Hide file tree
Showing 10 changed files with 665 additions and 36 deletions.
7 changes: 4 additions & 3 deletions lib/doc-card-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { strict as assert } from 'node:assert';

import { visit } from 'unist-util-visit';

const placeholder = ':docusaurus-doc-card-list';
const placeholder = 'docusaurus-doc-card-list';

function isDirective({ type, children: [line] = [] }, _, parent) {
return (
parent?.type === 'root' &&
type === 'paragraph' &&
line?.type === 'text' &&
line?.value === placeholder
line &&
((line.type === 'textDirective' && line.name === placeholder) ||
(line.type === 'text' && line.value === `:${placeholder}`))
);
}

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remark-docusaurus",
"version": "0.3.1",
"version": "0.3.2",
"description": "Remark plugin for docusaurus features",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -56,9 +56,11 @@
"garou": "^0.6.17",
"lodash": "^4.17.21",
"prettier": "^3.0.3",
"remark": "^12.0.1",
"remark": "^15.0.1",
"remark-admonitions": "^1.2.1",
"remark-directive": "^3.0.0",
"remark-mdx": "^1.6.22",
"remark12": "npm:remark@12",
"unist-util-remove-position": "^5.0.0"
},
"engines": {
Expand Down
Loading

0 comments on commit e9cc2ef

Please sign in to comment.