spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
813 stars 256 forks source link

fix: use the correct fonts path #295

Closed owen2345 closed 1 year ago

owen2345 commented 1 year ago

fix: use the correct fonts path issue: editor button icons are not visible (icon fonts not found) issue details:

When merged, could be great to have a new gem release. Thanks

spohlenz commented 1 year ago

I was initially hesitant to merge this in, as the vendor/assets/javascripts folder would technically be blown away the next time a new TinyMCE 4.x release was made. However since the last release was in July 2020, I think it is okay (albeit a little bit of a cludge).

FWIW, what is at the root of this issue is https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/rails/asset_url_processor.rb, which seems like it might be slightly buggy with relative asset paths. It can be disabled by setting config.assets.resolve_assets_in_css_urls to false, although that has potential to cause issues elsewhere if it is being relied upon.

spohlenz commented 1 year ago

Sorry, as soon as I wrote that comment I realised that unfortunately this isn't the way to go about fixing this, since it will now break in older versions of sprockets-rails or when config.assets.resolve_assets_in_css_urls is false.