RichText samples
editor api
get selection
Getting selection. Check documentation:
getSelection() method
Get selection