Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Question Marks inside ERB in Script Tags #230

Open

Description

@robertmaloney

Description

In Github (HTML+ERB) and Atom I notice this syntax bug when using HTML (ERB - Ruby) or HTML (Rails) highlighting:

<script type="text/javascript">
  variable = <%= Object.test? %>;
</script>

Expected behavior: The closing script tag should be highlighted.
Actual behavior: The closing script tag is not highlighted
Reproduces how often: 100%

My guess would be that the grammar believes this to be the start of a ternary statement. The following has correct highlighting but invalid syntax:

<script type="text/javascript">
  variable = <%= Object.test? true : false %>;
</script>

Versions

Atom : 1.25.1
Electron: 1.7.11
Chrome : 58.0.3029.110
Node : 7.9.0

language-ruby : 0.71.4
language-ruby-on-rails : 0.25.3

Activity

  1. masudhossain commented on May 22, 2019

    @masudhossain

    Seems like someone found a fix for this issue. But it hasn't been merged into master?

  2. rsese commented on May 30, 2019

    @rsese

    This looks like it's not an issue with HTML (ERB - Ruby) anymore @masudhossain? In Atom 1.37.0 on macOS 10.12.6:

    html-erb

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions