Fixed "text" to use selected text or page title.

I fixed "text" to use selected text or page title.
I'm happy if you review and pull it.