Block
List
Selection
Cursor Location / No selection
Check which markup which are active (active_markup) at cursor_pos/selection
If a single markup
Highlight active_markup
If selection has been made
If selection markup has no markup
If selection markup != wanted markup
If selection markup == wanted markup
If no selection has been made
If active markups != wanted markup
open_markup) to wanted markupIf active markups == wanted markup
If open_markup and it is of block type
open_markupIf open_markup and carrage return
If selection has been made
If selection has markup markup
If active markup