CMS MADE SIMPLE FORGE

TinyMCE

 

[#9927] @font-face rules not parsed correctly

avatar
Created By: Stephan (10010110)
Date Submitted: Tue Mar 25 16:21:25 -0400 2014

Assigned To: Rolf (rolf1)
Version: 2.9.12
CMSMS Version: 1.11.12
Severity: Major
Resolution: None
State: Closed
Summary:
@font-face rules not parsed correctly
Detailed Description:
I don’t know if it’s a problem of TinyMCE itself or a bug in this module but I
found out the following:

TinyMCE can parse the site’s stylesheets and use these styles in the editor
field. If you have custom embedded web fonts specified with @font-face the
generated stylesheet for TinyMCE appends the URL to the module directory which
invalidates the file paths; effectively the web fonts aren’t shown and
substituted with standard fallback fonts. So, for example, if you have this line
in the stylesheet:
@font-face {
	font-family: 'Example';
	src: url(/fonts/example.woff);
}
The generated TinyMCE stylesheet makes this out of it:
@font-face {
	font-family: 'Example';
	src: url(http://example.com/modules/TinyMCE//fonts/example.woff);
}

And moreso, apparently it looks for the string “url(” to append the URL directly
after it, disregarding anything that follows. It becomes obvious if the file
path is in quotes:

src: url('/fonts/example.woff');

becomes

src: url(http://example.com/modules/TinyMCE/'/fonts/example.woff');

Now, if you are also using [[root_url]] in your stylesheet this variable is also
converted to the module directory, so:

@font-face {
	font-family: 'Example';
	src: url([[root_url]]/fonts/example.woff);
}

becomes

@font-face {
	font-family: 'Example';
src:
url(http://example.com/modules/TinyMCE/http://example.com/modules/TinyMCE/fonts/example.woff);
}


History

Comments
avatar
Date: 2016-02-12 13:33
Posted By: Rolf (rolf1)

TinyMCE version 3.x is released, the module is a complete rewrite of all code.

Because of this, bug reports related to the old version are not relevant anymore
and will be closed. Please use the latest and finest release at your CMSMS 2.x
website and test again. If you feel like your issue still isn't fixed create a
new report. Thanks.
      
Updates

Updated: 2016-02-12 13:33
state: Open => Closed

Updated: 2015-01-28 12:34
resolution_id: => 5
cmsms_version_id: 30332 => 30607
assigned_to_id: 11306 => 9917