Skip to content
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

Merged
merged 12 commits into from
Feb 1, 2025

Conversation

patrick-hertling
Copy link
Contributor

Checklist

  • yarn typecheck
  • yarn lint:fix
  • yarn test
  • yarn brl
  • yarn changeset
  • ui changelog

Copy link

codesandbox bot commented Jan 31, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 56d3d21

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@udecode/plate-code-block Minor
@udecode/plate-basic-elements Minor

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

Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 2:27pm

Copy link
Member

@zbeyens zbeyens left a 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.

patrick-hertling and others added 7 commits February 1, 2025 12:39
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>
Copy link
Member

@zbeyens zbeyens left a 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 = (
Copy link
Member

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

Copy link
Member

@zbeyens zbeyens left a 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 :)

Comment on lines 33 to 39
export const isValidSyntax = (code: string, language: string) => {
return _isValidSyntax(code, language);
};

export const isLangSupported = (element: TCodeBlockElement) => {
return _isLangSupported(element.lang);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate, can be removed

@zbeyens zbeyens merged commit 3eb6478 into udecode:main Feb 1, 2025
6 checks passed
@patrick-hertling patrick-hertling deleted the feature/code-block-json-format branch February 2, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants