A new markup editor helper
Markup types
-
Block
- Markup before and optionally after block
- Block may contain several rows
- Block may also be a list item och table item
- Block may also be open i.e. start identifier has been entered but not end marker
-
List
- In list each row have a block operation
- Block operations may be different on each line
Attributes
- Markups may have different attributes associated with the markup
- The same markups may be used on different markup types
Selection types
-
Selection
- Only text covered by selection is modified
-
Cursor Location / No selection
- All markup types around cursor location is identified and included in scope selection
Open issues
- Should nested markups be supported
Interaction flow
Show current markups
-
Check which markup which are active (
active_markup) at
cursor_pos/
selection` -
If a single markup
- Identify attributes for markup
- Highlight attributes
-
Highlight
active_markup
Change markup for selection
-
If selection has been made
-
If selection markup has no markup
- Set wanted markup
-
If selection markup != wanted markup
- Change selection markup to wanted markup
-
If selection markup == wanted markup
- Remove current markup
-
Enter markup
-
If no selection has been made
-
If active markups != wanted markup
- Output beginning markup
- Set open markup (
open_markup
) to wanted markup
-
If active markups == wanted markup
- Make selection for active markup
- Remove current markup
-
Exit markup
-
If
open_markup
and it is of block type- Output end markup
- Clear
open_markup
Carrage return in open block markup
-
If
open_markup
and carrage return- Output end markup for row
- Output begin markup for next row (at the same location as last row)
Change attribute
-
If selection has been made
-
If selection has markup markup
- Change markup attribute to wanted attribute
-
-
If active markup
- Change markup attribute to wanted attribute
References
- TEH
- MarkItUp
- Different desktop editors