Add toggling for formatting operations and fix list formatting
All formatting operations now support toggling. For now, the detection for preexisting formatting is kept pretty basic, i.e. it does only check for the formatting that would be applied by the same operation. The cursor position or selection is now adjusted in a way that the original position(s) in the text is preserved.
This also switches from asterisk to underscore for italic formatting so there is no overlap which would cause detection issues.
Furthermore fixed list formatting when text is selected.
Refactoring:
- Introduced new
openingTag
andclosingTag
(string
) properties. - Removed the old
signs
,closingTag
(boolean
) andstartPos
properties. They can easily be derived fromopeningTag
andclosingTag
(string
).
Closes: #920 (closed), #940 (closed)
Edited by Daniel Gerhardt