Skip to content

Conversation

@josh-ramos-22
Copy link
Contributor

Why are the changes needed?

Currently, code blocks in published blogs are displayed as plain text without syntax highlighting.

Changes

  • next/src/components/blog/types.ts - added type definitions for code blocks
  • Imported PrismJS for syntax highlighting support
  • next/src/components/blog/Blog.tsx - added handler for when element.type == "code" in order to properly display code blocks
  • next/src/components/blog/Blog-styled.tsx - styling for code blocks

Screenshots

Screenshot 2023-06-17 174203

Notes

  • Discovered a bug where republished documents would fail to load as a blog when a line is shorter than its original length. Further investigation required,

Copy link
Contributor

@lauraw0 lauraw0 left a comment

Choose a reason for hiding this comment

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

lgtm! :D

@josh-ramos-22 josh-ramos-22 merged commit 387be22 into main Sep 4, 2023
@josh-ramos-22 josh-ramos-22 deleted the NEXT_Format_blog_to_display_code branch September 4, 2023 00:53
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.

3 participants