Posts

Showing posts from August, 2014

DOMCursor, a tool for filtered DOM tree cursoring

While working on Leisure , I searched for tools to traverse text in DOM trees, but most of the ones I found were fairly limited.  One nice one is Rangy ( https://github.com/timdown/rangy ), which has a TextRange that can traverse by characters and words with rules for skipping over invisible text, collapsing contiguous whitespace, etc. Leisure, however is what you might call an “ultra-rich text” environment and needs more power.   This isn't my announcement of Leisure, by the way -- it's got a bit farther to go for that -- so consider this a teaser :). Leisure documents are orgmode files and the environment has a couple ways to present them, some of which sprinkle controls and views in among the editable text. During the design, I decided to use the contenteditable attribute and use the text in among the sprinkled controls and views as the actual document text, as opposed to emulating document editing, like code mirror does . Over the years, I experimented with different ...