possibility to have id_map assigned to element.data() and not necessarily in a hidden field
added copyright
cut contents at cursor position, otherwise if you have multiple triggers only the last will work
insert space after selection only if needed and compute the new caret position accordingly