When I have the cursor on a line of text and press the H1 button I expect that the current line changes to H1. It is a bit surprising to have a new line opened with an H1 and highlighted default text.
--
TWiki:Main/PeterThoeny
- 27 Apr 2007
No, this does not work like this. All button actions are configured by a triplet:
- starting tag, e.g. <div style="text-align:center">
- default content, e.g.
Centered text
- closing tag, e.g. </div>
When you highlight a part of the text, this selection will be used instead of
the default content.
So in your use case, don't just type "some text" and then press h1 to expect it to become
---++ some text
. Select the text first and then press h1 will
work just perfect.
All buttons work like this: select some text, then press
bold to get the selection bold. I'd prefer to leave it like
it is.
--
TWiki:Main.MichaelDaum
- 27 Apr 2007
Hmm, I find it more consistent to distinguish between operations that happen within a flow of text (bold, italic, monospaced, etc) and those that operate on line(s) of text (heading, bullets, verbatim).
For operations that happen within a flow of text:
- If text is selected: Enclose text with markup
- If text is not selected: Add markup with highlighted default text
For operations on line(s) of text:
- If text is selected: Enclose text with markup
- If text is not selected: Select current line, then do same action as above
--
TWiki:Main.PeterThoeny
- 27 Apr 2007
Hm, I don't get away with this minimal amount of javascripth the current editor is using...
--
MichaelDaum - 27 Apr 2007
Stale: Setting unmaintained extension to "no action required".
--
PeterThoeny - 2010-10-12