Skip to content

Commit

Permalink
fix(mdx): className bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Dec 3, 2023
1 parent dc0927b commit 174f788
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 112 deletions.
7 changes: 6 additions & 1 deletion lib/ast.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
function attrString(attributes = []) {
return attributes.length > 0
? attributes.map(({ name, value }) => ` ${name}="${value}"`).join('')
? attributes
.map(
({ name, value }) =>
` ${name === 'className' ? 'class' : name}="${value}"`,
)
.join('')
: '';
}

Expand Down
6 changes: 3 additions & 3 deletions lib/transform.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const modes = {
},
{
type: 'mdxJsxAttribute',
name: 'class',
name: 'className',
value: 'kroki-object',
},
{
Expand Down Expand Up @@ -72,7 +72,7 @@ const modes = {
attributes: [
{
type: 'mdxJsxAttribute',
name: 'class',
name: 'className',
value: 'kroki-image',
},
{
Expand Down Expand Up @@ -102,7 +102,7 @@ const modes = {
attributes: [
{
type: 'mdxJsxAttribute',
name: 'class',
name: 'className',
value: 'kroki-inline-svg',
},
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remark-kroki",
"version": "0.3.0",
"version": "0.3.1",
"description": "Remark plugin for showing Kroki diagram",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -61,7 +61,7 @@
"@nice-move/eslint-config-base": "^0.9.24",
"@nice-move/prettier-config": "^0.9.8",
"ava": "^5.3.1",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"eslint-plugin-ava": "^14.0.0",
"garou": "^0.6.19",
"prettier": "^3.1.0",
Expand Down
Loading

0 comments on commit 174f788

Please sign in to comment.