mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 11:14:31 -04:00
Remove "\/" from escaped JavaScript to prevent test errors.
We were getting annoying "couldn't close <p> with </script>" messages when running tests, because escape_javascript was turning </p> into <\/p>. We fixed this by gsub'ing \/ to / after calling escape_javascript. What could possibly go wrong? :-)
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
|
||||
- Member.located.each do |m|
|
||||
- popup = render :partial => 'members/popover', :locals => { :member => m }
|
||||
- popup.gsub!(/\n/, "") # Linebreaks in strings break JavaScript
|
||||
- popup = escape_javascript(popup).gsub(/\\\//, "/")
|
||||
:javascript
|
||||
marker = new L.Marker(new L.LatLng(#{m.latitude}, #{m.longitude}));
|
||||
marker.bindPopup('<p>#{link_to m, m}</p> #{ escape_javascript(popup) }').openPopup();
|
||||
marker.bindPopup('<p>#{link_to m, m}</p> #{ popup }').openPopup();
|
||||
map.addLayer(marker);
|
||||
|
||||
%h3
|
||||
|
||||
Reference in New Issue
Block a user