Fixing Blogger's post editor's keybindings
The Blogger post editor has rather nice Ctrl+B / Ctrl+I key bindings for making the current selection bold / italic. Unfortunately they generate
<span style="font-weight:bold;">
and <span style="font-style:italic;">
abhorrations instead of proper HTML <b>
and <i>
tags. Let's make a Greasemonkey script to fix that, shall we?
I would point out that the blogger post editor buttons themselves generate the same span tags that the shortcut keys do.
Would you happen to know of a regexps in javascript tutorial you could refer me to? I seem to have mostly got the expressions themselves matching, but i'd like to know how to include elements that matched the wildcards i the replacement string...
Interesting; I never actually tried them. :-) That might mean... ...yes. It's dead simple fixing it. Using this scriptlet, for instance: javascript:Textbar.Bold=function(){ this.wrapSelection('<b>','</b>'); };Textbar.Italic=function(){ this.wrapSelection('<i>','</i>'); };void 0.
Thanks. :-) Regarding regexps, I'm not quite sure about good tutorials, but perhaps this one is useful? I very warmly recommend David Flanagan's Javascript: the Definitive Guide, otherwise. It's not online, but it's great, and that covers the regexp bits too. All except the kitchen sink, which in this case would be XMLHttpRequest.
The shortcut keys are tied directly to the buttons? Well, that would definately make it simpler :)
Thanks for the info regarding the regexps too :)
I'd say that the Blogger post editor has horrible key bindings that collide with standard Emacs key bindings, and that's evil.