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

Adding erb if/else statement with ? inside <script> tags causes bug with syntax highlighting #43

Open
masudhossain opened this issue May 19, 2019 · 1 comment

Comments

@masudhossain
Copy link

masudhossain commented May 19, 2019

Describe the bug
Adding erb if/else statement with an ? (example: `<% if @user.present? %>) inside script tags causes syntax highlighting error. If you copy/paste the code below into your index.html.erb file you'll see what i mean.

To Reproduce

  1. Copy and paste code below into index.html.erb
<script>
  $('#video).click(function(e) {
    <% if params[:live].present? %>
      updatePausePlayLive();
    <% end %>
  });
  </script>
  
  <!--Mentions-->
  <script>
  console.log('hello world');
  </script>

Expected behavior
Properly syntax highlighting the <!--Mentions-->

Screenshots
https://slack-imgs.com/?c=1&url=https%3A%2F%2Fimage.prntscr.com%2Fimage%2F3-905fIHQ8GKiJKqwqBHUQ.png

Additional context

@masudhossain masudhossain changed the title Adding erb if/else statements inside <script> tags causes bug Adding erb if/else statement with ? inside <script> tags causes bug with syntax highlighting May 19, 2019
@bung87
Copy link
Owner

bung87 commented Oct 7, 2019

Thank you ! I checked the ruby extension it also not work very well, I dont have a solution for now.

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