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

Incorrectly highlighted regex #47

Closed
thedaniel opened this issue Aug 12, 2014 · 13 comments
Closed

Incorrectly highlighted regex #47

thedaniel opened this issue Aug 12, 2014 · 13 comments
Assignees

Comments

@thedaniel
Copy link

this code has broken highlighting - note the red closing slash on the regex and wash of redness below it

screen shot 2014-08-12 at 12 20 10 pm

new_node = node.to_s.gsub(/{(\w+)}/) { "<a href=\"/docs\/#{context[:doc_version]}\/api\/classes\/#{$1}\">#{$1}</a>" }
@deiga
Copy link

deiga commented Aug 14, 2014

This happens whenever there are to forward slashes on the same line. Notice the rest of the methods turning green (String colored)
application_helper_rb_-__users_timosand_dropbox_development_epassi

@rpechayr
Copy link

rpechayr commented Sep 8, 2014

👍 I am having the same issue and just posted it to atom/atom: issues
atom/atom#3490
They pointed me to the project

@kevinsawicki
Copy link
Contributor

Just going to include the snippet that was causing issues in atom/atom#3490 here:

    value1 = value2 / (1.0 - (percentage / 100.0))

@kevinsawicki
Copy link
Contributor

@rpechayr after looking into this more, your issue isn't the same as this one so I'm going to open up a new one for it, #55

@deiga
Copy link

deiga commented Sep 11, 2014

Are you sure that this commit fixes this issue? I tried making the changes on my local installation and it didn't seem to fix the issue.

@kevinsawicki
Copy link
Contributor

@deiga The commit should fix the issue @thedaniel was seeing, can you include a code snippet of what you are still seeing failing?

@angelman
Copy link

The enormous regular expression found in the following URL causes all subsequent code to be colored as part of the regex.

https://github.com/jzaefferer/jquery-validation/blob/master/src/core.js#L1119

I know this is a line of Javascript, but the regex works just fine in Ruby. Here's a screenshot of what this looks like in Atom.

screen shot 2014-09-11 at 4 26 15 pm

@kevinsawicki
Copy link
Contributor

@angelman I think you are seeing atom/atom#1667

@angelman
Copy link

@kevinsawicki You are right. Never mind. :)

@deiga
Copy link

deiga commented Sep 12, 2014

@kevinsawicki It's still the same as in #47 (comment)

@kevinsawicki
Copy link
Contributor

@deiga that could be a different issue, mind including the code snippet? It makes it much quicker to reproduce than retyping it from a screenshot.

@deiga
Copy link

deiga commented Sep 12, 2014

@kevinsawicki

def format_amount_get_cents(price)
    sprintf("%.2f", Float(price)/100).split(/[.,]/)[1]
  end

  def format_short_month(date)
    date.strftime("%b")
  end

kevinsawicki added a commit that referenced this issue Sep 12, 2014
Only consume / if they are escaped before the ending /

Refs #47
@kevinsawicki
Copy link
Contributor

@deiga Great, thanks for the snippet, just pushed a fixed for it

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants