You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Absolutely - my apologies for not explaining in the first instance. Due to having both a work and personal Dropbox account, the path in question (on macOS) begins: /Users/kitebuggy/Dropbox (Company)/Dev/bullet_train/...
Any path with brackets like these (or any other characters with special meaning in RegEx) will result in the failure of this call unless it is escaped, as gsub will assume that path is a Regexp and not a fixed string.
I agree that partial_location.delete_prefix!(path) would also work, is prettier, and should save a CPU cycle or six too.
Issue stems from the self.locale_prefix_from method in nice_partials.rb:
root_paths.each { |path| partial_location.gsub!(/^#{path}\//, '') }
Can be resolved by simply using Regexp.escape, as follows:
root_paths.each { |path| partial_location.gsub!(/^#{Regexp.escape(path)}\//, '') }
Seems too simple for a proper PR, hope this works instead?
The text was updated successfully, but these errors were encountered: