Clip for Editing Text: strikeout deletion / bold insertion

;whacked at by don at htmlfixit dot com
;from an example by hoylesp at acm dot org
;to edit stuff with three options (1a, 1b and 2)
;if highlighted text when start, then strike that
; and a.
; nothing if text box left empty
; or b.
; replace with bolded text from prompt box if entered
;if nothing selected insert added text
;see: for any updates

;figure out if anything is selected and jump to subroutine
^!If ^$GetCol$ = ^$GetColEnd$ insert ELSE selection_made

;we have a selection so strike it
^!InsertHTML ^&
;move after the selection
^!Jump Select_End

;insert the replace with text if any is given
^!Set %replacement%=^?{Replace with}
;if nothing entered in Replace jump to end
^!If ^$IsEmpty(^%replacement%)$ = 1 End
;insert in bold with spaces on each side
;if replacement text is given

Leave a Reply

Recent Posts