-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json formatting in code-block plugin #4043
json formatting in code-block plugin #4043
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 56d3d21 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I've left a few request changes since for this use-case we don't use class and hooks anymore.
apps/www/src/registry/default/plate-ui/code-block-format-button.tsx
Outdated
Show resolved
Hide resolved
apps/www/src/registry/default/plate-ui/code-block-format-button.tsx
Outdated
Show resolved
Hide resolved
apps/www/src/registry/default/plate-ui/code-block-format-button.tsx
Outdated
Show resolved
Hide resolved
apps/www/src/registry/default/plate-ui/code-block-format-button.tsx
Outdated
Show resolved
Hide resolved
apps/www/src/registry/default/plate-ui/code-block-format-button.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
…n.tsx Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
…n.tsx Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
…n.tsx Co-authored-by: Ziad Beyens <ziad.beyens@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last request, please also include a minor changeset :)
formatCode, | ||
} from '../../lib/formatter/formatter'; | ||
|
||
export const formatCodeBlock = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be moved to lib folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last request, please also include a minor changeset :)
export const isValidSyntax = (code: string, language: string) => { | ||
return _isValidSyntax(code, language); | ||
}; | ||
|
||
export const isLangSupported = (element: TCodeBlockElement) => { | ||
return _isLangSupported(element.lang); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate, can be removed
Checklist
yarn typecheck
yarn lint:fix
yarn test
yarn brl
yarn changeset