Fix #4111: Cache custom CSS.

This commit is contained in:
evazion
2019-08-01 00:06:18 -05:00
parent efc5487dd6
commit 692981e964
5 changed files with 18 additions and 12 deletions

11
app/logical/custom_css.rb Normal file
View File

@@ -0,0 +1,11 @@
module CustomCss
def self.parse(css)
css.to_s.split(/\r\n|\r|\n/).map do |line|
if line =~ /\A@import/
line
else
line.gsub(/([^[:space:]])[[:space:]]*(?:!important)?[[:space:]]*(;|})/, "\\1 !important\\2")
end
end.join("\n")
end
end