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

feat: added support for diff with syntax highlight #53

Merged
merged 3 commits into from
Aug 21, 2022

Conversation

Code-Victor
Copy link
Contributor

added support for syntax highlighting for diff
by using the diff: prefix you can get syntax highlight and diff for your code
mdx-snippet
mdx code
mdx-result
result

@timlrx
Copy link
Owner

timlrx commented Aug 20, 2022

Looks mostly good to me, but perhaps we can use diff-js instead of diff:js. The dash seems to be more widely used, similar to the prism plugin and gatsby's implementation.

Could you also help to add a test case. Thanks!

@timlrx
Copy link
Owner

timlrx commented Aug 20, 2022

One of the test case also fails, so that requires a closer look.

@Code-Victor
Copy link
Contributor Author

Noted, I'll implement the diff-js and look into the error.

@Code-Victor
Copy link
Contributor Author

I've fixed the error with optional chaining and added a test for the diff-* syntax

Copy link
Owner

@timlrx timlrx left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me!

@timlrx timlrx merged commit fadb391 into timlrx:main Aug 21, 2022
@timlrx timlrx mentioned this pull request Aug 21, 2022
@Code-Victor Code-Victor deleted the diff-syntax-highlight branch August 21, 2022 13:22
Kamigami55 added a commit to Kamigami55/nextjs-tailwind-contentlayer-blog-starter that referenced this pull request Sep 3, 2022
Kamigami55 added a commit to Kamigami55/nextjs-tailwind-contentlayer-blog-starter that referenced this pull request Sep 3, 2022
Kamigami55 added a commit to Kamigami55/nextjs-tailwind-contentlayer-blog-starter that referenced this pull request Sep 3, 2022
Kamigami55 added a commit to Kamigami55/nextjs-tailwind-contentlayer-blog-starter that referenced this pull request Sep 3, 2022
Kamigami55 added a commit to Kamigami55/nextjs-tailwind-contentlayer-blog-starter that referenced this pull request Sep 3, 2022
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