From 9dfcd4030cefa16c212f435c5e2b8f515eaa8261 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 27 Jun 2014 02:59:13 +0000 Subject: [PATCH] TinyMCE: force 'font-weight: bold` for and inside the editor or Chrome and Safari may replace them with spans on pasting. Fixes #28656. git-svn-id: https://develop.svn.wordpress.org/trunk@28866 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 2 ++ src/wp-includes/js/tinymce/skins/wordpress/wp-content.css | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index f7f2b3cd40..91dff3870a 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -297,6 +297,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } else if ( env.ie < 8 ) { bodyClass.push('ie7'); } + } else if ( env.webkit ) { + bodyClass.push('webkit'); } bodyClass.push('wp-editor'); diff --git a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css index e55bdabe09..ec5182cb55 100644 --- a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -17,6 +17,13 @@ body { margin: 10px; } +/* When font-weight is different than the default browser style, +Chrome and Safari replace and with spans with inline styles on pasting?! */ +body.webkit strong, +body.webkit b { + font-weight: bold !important; +} + /* DFW mode */ html.wp-fullscreen, html.wp-fullscreen body {