From ebbec0186c8a40c77145ce0ac76a0d42954b732c Mon Sep 17 00:00:00 2001 From: r888888888 Date: Wed, 1 Jun 2016 13:25:22 -0700 Subject: [PATCH] fixes #2601: custom Css, do not add "important;" to lines starting with @ --- app/views/users/custom_style.css.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/users/custom_style.css.erb b/app/views/users/custom_style.css.erb index 9c3d36e13..bb59065fd 100644 --- a/app/views/users/custom_style.css.erb +++ b/app/views/users/custom_style.css.erb @@ -1 +1,7 @@ -<%= CurrentUser.user.custom_style.gsub(/(\S)\s*(?:!important)?\s*(;|})/, "\\1!important\\2").html_safe %> \ No newline at end of file +<% CurrentUser.user.custom_style.split.each do |line| %> + <% if line =~ /^@import/ %> + <%= raw(line) %> + <% else %> + <%= raw(line.gsub(/(\S)\s*(?:!important)?\s*(;|})/, "\\1 !important\\2")) %> + <% end %> +<% end %>