TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.56k stars 2.06k forks source link

Bug: EJS syntax highlighting not supported #4497

Closed MaoShizhong closed 2 months ago

MaoShizhong commented 2 months ago

Checks

Bug description

At least going by the markdown preview tool, ejs as a fenced code block language does not produce any syntax highlighting at all, unlike other languages including erb.

How to reproduce

  1. Go to the [markdown preview tool].
  2. Enter the following code:
    ```ejs
    <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>
  3. Preview it - observe how there is no syntax highlighting at all. No difference if the language is eta (Prism's alternative language code for EJS).
  4. Change the code block language to html or erb - see how there is syntax highlighting (albeit not complete due to being the incorrect language).

Expected behavior

The above, except with the code block appropriately coloured as per ejs (Prism should support EJS highlighting).

What browsers are you seeing the problem on?

Firefox, Chrome

What OS are you using?

Ubuntu

Discord Name

No response

Additional Comments

No response

JoshDevHub commented 2 months ago

Yep that's definitely a problem, but should be an easy fix. I'll knock it out real quick.