When I include code samples
within a phrase of one of my answers, I find it hard to see that code from the rest of the phrase.
Because of this, I like to put quotes around code, like this: 'code sample
', or this: "code sample
".
Since we already have a shortcut for making text a code sample (CTRL+K), I would like to reuse that shortcut in order to put quotes around it.
That would mean the following phrase:
my clever answer with a code sample function() call in it
would become, with 'code sample function()' highlighted:
- first CTRL+K:
my clever answer with a
code sample function()
call in it
(just like today)
- second CTRL+K:
my clever answer with a "
code sample function()
" call in it
(oh! I see now you function() call)
- third CTRL+K:
my clever answer with a '
code sample function()
' call in it
(a more subtle way to signal the code sample part of the phrase)
- fourth CTRL+K:
my clever answer with a code sample function() call in it
(back to normal, no more <code>
around the text, just like today, and you can then repeat the cycle)
I have tested this feature in my own version of WMD and it works great (see my answer below).
But before bugging Dana.E.Robinson with a patch, I would like to see what the community thinks about this proposition.