Skip to content

Add toggling for formatting operations and fix list formatting

Daniel Gerhardt requested to merge toggle-formatting into master

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 and closingTag (string) properties.
  • Removed the old signs, closingTag (boolean) and startPos properties. They can easily be derived from openingTag and closingTag (string).

Closes: #920 (closed), #940 (closed)

Edited by Daniel Gerhardt

Merge request reports