TinyMCE allows for relative urls for content_css, however the current transformer first checks with ActionController::Base to find the path for the given file, which can raise an error when the path given starts with . or .. (seen on Rails 4.2.10 - though the error itself gets raised further down in sprockets).
This adds an additional check the transformer for paths starting with /, ., and .., and passes that through to the tinymce configuration before going through the rails/sprockets pipeline. This mirrors how other configurations (ex. image_list or images_upload_url) pass a given path to TinyMCE.
This would allow an app to configure the editor to retrieve css from an endpoint relative to where the editor itself loads - such as stylesheets managed by users for a CMS, for example.
TinyMCE allows for relative urls for content_css, however the current transformer first checks with
ActionController::Base
to find the path for the given file, which can raise an error when the path given starts with.
or..
(seen on Rails4.2.10
- though the error itself gets raised further down insprockets
).This adds an additional check the transformer for paths starting with
/
,.
, and..
, and passes that through to thetinymce
configuration before going through the rails/sprockets pipeline. This mirrors how other configurations (ex.image_list
orimages_upload_url
) pass a given path toTinyMCE
.This would allow an app to configure the editor to retrieve
css
from an endpoint relative to where the editor itself loads - such as stylesheets managed by users for a CMS, for example.