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

Fix: Add ejs to Prism language configuration #4498

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

JoshDevHub
Copy link
Contributor

Because

Code examples using ejs weren't being given proper syntax highlighting.

This PR

  • adds "ejs" to the languages array in the configuration for Prism (the library used to provide syntax highlighting).

Issue

Closes #4497

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the keyword: brief description of change format, using one of the following keywords:
    • Feature - adds new or amends existing user-facing behavior
    • Chore - changes that have no user-facing value, refactors, dependency bumps, etc
    • Fix - bug fixes
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • I have verified all tests and linters pass after making these changes.
  • If this PR addresses an open issue, it is linked in the Issue section
  • If applicable, this PR includes new or updated automated tests

@JoshDevHub JoshDevHub added the create-review-app Create a Heroku review app for pull request label Apr 13, 2024
@github-actions github-actions bot removed the create-review-app Create a Heroku review app for pull request label Apr 13, 2024
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4498 April 13, 2024 18:55 Inactive
@JoshDevHub
Copy link
Contributor Author

JoshDevHub commented Apr 13, 2024

To QA:

  1. Visit the preview tool in the review app (the path is /lessons/preview)
  2. Paste this code in. Fence it with triple backticks and add the language ejs after the opening set of backticks:
<nav>
   <ul>
     <% for (let i = 0; i < links.length; i++) { %>
       <li>
         <a href="<%= links[i].href %>">
           <span> <%= links[i].text %> </span>
         </a>
       </li>
     <% } %>
   </ul>
 </nav>
  1. Preview the markup and confirm that there's highlighting.

Here's what it currently looks like on main for comparison:
image

Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

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

Nice and simple, thanks @JoshDevHub.
Had thought it just needed this, but didn't see html and wasn't sure if there were other things as well. But then I realised that markup contains html so has that covered there 😅

Test deployment's working well!

@MaoShizhong MaoShizhong merged commit 6ce2b78 into main Apr 13, 2024
5 checks passed
@MaoShizhong MaoShizhong deleted the add_ejs_syntax_highlighting branch April 13, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bug: EJS syntax highlighting not supported
3 participants