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

Add syntax highlighting for Markdown code blocks #255

Merged

Conversation

flybot-nam-nguyenhoai
Copy link
Contributor

@flybot-nam-nguyenhoai flybot-nam-nguyenhoai commented Aug 4, 2023

Closes #254

New features

  • Syntax highlight code blocks in posts.
    • Format code blocks without any specified languages as plain text blocks.
  • Add syntax highlighting themes that match the current website themes.

Fix

  • Fix the HTML id attribute for posts: id should begin with a letter.1
    This is required for the CSS selector used for syntax highlighting to work properly.

Footnotes

  1. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id

@flybot-nam-nguyenhoai flybot-nam-nguyenhoai marked this pull request as ready for review August 4, 2023 05:50
@flybot-nam-nguyenhoai flybot-nam-nguyenhoai marked this pull request as draft August 4, 2023 06:12
This commit resolves the unescaped HTML warning that appears when
highlighting is applied to a code block more than once.
@flybot-nam-nguyenhoai flybot-nam-nguyenhoai marked this pull request as ready for review August 4, 2023 07:23
@skydread1 skydread1 self-requested a review August 4, 2023 07:26
Copy link
Owner

@skydread1 skydread1 left a comment

Choose a reason for hiding this comment

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

Good job!

@skydread1 skydread1 merged commit 56a701b into skydread1:master Aug 4, 2023
2 checks passed
@flybot-nam-nguyenhoai flybot-nam-nguyenhoai deleted the 254-code-syntax-highlighting branch August 4, 2023 07:46
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.

Markdown code blocks are not syntax highlighted
2 participants