mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Replace R2 gem with rtlcss for generating RTL CSS (#19636)
We've had a couple of problems with the R2 gem where it generated a broken RTL CSS bundle that caused a badly broken layout when Discourse is used in an RTL language, see a3ce93b and 5926386. For this reason, we're replacing R2 with `rtlcss` that can handle modern CSS features better than R2 does. `rltcss` is written in JS and available as an npm package. Calling the `rltcss` from rubyland is done via the `rtlcss_wrapper` gem which contains a distributable copy of the `rtlcss` package and loads/calls it with Mini Racer. See https://github.com/discourse/rtlcss_wrapper for more details. Internal topic: t/76263.
This commit is contained in:
@ -65,8 +65,8 @@ module Stylesheet
|
||||
result = engine.render
|
||||
|
||||
if options[:rtl]
|
||||
require "r2"
|
||||
[R2.r2(result), nil]
|
||||
require "rtlcss_wrapper"
|
||||
[RtlcssWrapper.flip_css(result), nil]
|
||||
else
|
||||
source_map = engine.source_map
|
||||
source_map.force_encoding("UTF-8")
|
||||
|
Reference in New Issue
Block a user