jakiestfu / Medium.js

A tiny JavaScript library for making contenteditable beautiful (Like Medium's editor)
http://jakiestfu.github.io/Medium.js/
4.39k stars 403 forks source link

Format piece of text programmatically based on first-last character indices of the raw text #196

Open bartonaz opened 8 years ago

bartonaz commented 8 years ago
  1. Is it possible to get from the Medium instance the string of raw unformatted text, without any HTML tags, like DOM innerText property would do?
  2. In case I have such string, either from Medium or directly through DOM, how is it possible to invokeElement when there is no actual text selected, but there are indices of the first and last characters (with respect to the raw text) of the string that should be invoked?