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

Highlighting ERB examples incorrectly #2602

Closed
colebemis opened this issue Oct 23, 2020 · 1 comment
Closed

Highlighting ERB examples incorrectly #2602

colebemis opened this issue Oct 23, 2020 · 1 comment

Comments

@colebemis
Copy link

Information

  • Language: ERB
  • Plugins: none

Description

Prism seems to be having trouble parsing more complicated ERB examples. Here's a ViewComponents example that it's parsing incorrectly:

image

If it helps, here's a link to the PR where I introduced ERB syntax highlighting into my project: primer/doctocat#203

Code snippet

The code being highlighted incorrectly.
<div style="padding-left: 60px">
  <%= render(Primer::TimelineItemComponent.new) do |component| %>
    <% component.slot(:avatar, src: "https://github.com/github.png", alt: "github") %>
    <% component.slot(:badge, bg: :green, color: :white, icon: :check) %>
    <% component.slot(:body) { "Success!" } %>
  <% end %>
</div>
@RunDevelopment
Copy link
Member

That's because you are using Ruby to highlight the snippet instead of ERB. With ERB, the snippet is highlighted just fine. See for yourself here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants