diff --git a/static/js/Editor.js b/static/js/Editor.js index 1c7c4e0..e8d60d4 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -362,8 +362,6 @@ Editor.prototype.cleanup_html = function ( key_code ) { continue; var replacement = withDocument( this.document, function () { - if ( style == undefined ) - return createDOM( "span" ); // font-size is set when ending title mode if ( style.indexOf( "font-size: " ) != -1 ) return null; diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 429e4a2..85f0ae6 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -4245,6 +4245,10 @@ function Font_pulldown( wiki, notebook_id, invoker, anchor, editor ) { ]; var self = this; + var current_font_family = editor.query_command_value( "fontname" ); + if ( WEBKIT ) + current_font_family = current_font_family.replace( /'/g, "" ).replace( /-webkit-/, "" ); + for ( var i in fonts ) { var font = fonts[ i ]; var font_name = font[ 0 ]; @@ -4255,7 +4259,7 @@ function Font_pulldown( wiki, notebook_id, invoker, anchor, editor ) { ); var selected_mark_char = document.createTextNode( "\u25cf" ); - if ( editor.query_command_value( "fontname" ) == font_family ) { + if ( font_family.search( current_font_family ) == 0 ) { var selected_mark = createDOM( "span", {}, selected_mark_char ); this.initial_selected_mark = selected_mark; } else {