Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad ++ highlights everything that comes after <%= in html.erb files

alt text

See the image above. I'm working on notepad ++. html.erb files are presented that way, and I don't know how to get rid of the sky blue highlighting that follows <%=.

like image 285
Jason Kim Avatar asked Dec 18 '10 23:12

Jason Kim


People also ask

What is HTML ERB file?

As @Chowlett mentioned before, erb stands for Embedded Ruby. When you define any file as ". html. erb" that means it's an HTML file with ruby code embedded in it and it is similar to ". rhtml" extension of rails file.

How do I view HTML ERB?

View templates HTML tags provide static web pages only but ERB tags give us dynamic information in that HTML template. To view the template file, go to Rails application >> app >> View>> Home folder where the templates files are available.

How do I enable syntax highlighting in Notepad ++?

To configure syntax highlighting, click on “Language” in the top bar, then click the letter the language starts with, and then the language. If you want to define your own language, click on “Language” again, then click on “User Defined Language”, third from the bottom, and then click “Define your language”.


3 Answers

zsalzbank, Ben and peterjwest are all correct. Here's some new information:

SciTE 2.29 has a version of SciLexer.dll that doesn't crash Notepad++ 5.9.3 and also interprets the single quote correctly.

I downloaded it from here: http://sourceforge.net/projects/scintilla/files/SciTE/2.29/ - the file you need is wscite229.zip

You can copy the new SciLexer.dll from the SciTE download into the Notepad++ folder.

UPDATE: Full instructions here: http://blog.dominicsayers.com/how-to-edit-erb-files-using-notepad/

like image 192
Dominic Sayers Avatar answered Sep 19 '22 00:09

Dominic Sayers


I think your problem is the commented out end tag on that line. The %> is being commented out. Try using " instead of ' for your strings.

like image 27
zsalzbank Avatar answered Sep 19 '22 00:09

zsalzbank


Here's a good article on it: http://therubyway.wordpress.com/2008/11/23/rails-on-notepad/

Essentially you just need to replace the scilexer.dll file (downloadable from the link) to fix the bugged <% %> syntax highlighting

Important Update:

Unfortunately this causes a crash on save (and will empty the file) on the new version of Notepad++, if you really want to use this it may work on an older version such as 5.8, you will have to test this.

like image 33
peterjwest Avatar answered Sep 22 '22 00:09

peterjwest