<commit_before># Spytext - The Tiny But Fully Functional RTE for the Web

Currently very buggy, but only due to massive refactoring.  And more
refactoring is going to be needed. But soon. Ish.  Hopefully by the middle of
summer 2015 this will be ready in all of its glory.

And now for a quote to distract you from the mess.

Always the seer is a __sayer__. Somehow his dream is told: somehow he publishes it
with solemn joy: sometimes with pencil on canvas: sometimes with chisel on
stone; sometimes in towers and aisles of granite, his soul's worship is
builded; sometimes in anthems of indefinite music; but clearest and most
permanent, in words. 
- <NAME>

## Why ?

Simply because there are no other really good, bare-bone text editors using
`contentEditable`. Most browsers behave very differently in handling
line breaks, new blocks, backspaces, deletes, formatting etc. So basically
we have overriden all these actions with our own DOM manipulating actions.
The only things we use native actions for is actual typing and text traversal (arrow buttons,
page up, etc). Even the undo/redo has been completely replaced to allow us to modify
the DOM howerver we like, but still be able to go back to previous changes.
This might sound like a daunting task, but it turned out to be quite simple.
And thus it is also very small, just look below.

Current functions are styling text with italic, bold or underline. Change
between P, H1, H2, H3, H4, H5 and H6 blocks for text. Create ordered and
unordered lists and undo/redo (in the seperate module snapback).

## Spytext is Tiny

Though 
          | Unminified  | Minified  | Compressed
----------|-------------|-----------|-------------
jQuery		| Doesn't count| Doesn't count |
Spytext     | 33.1kb      | 19.5kb    |
Snapback  | 6.69kb      | 2.94kb    |
Selectron | 6.27kb      | 3kb       |
Total:    | 46.06kb     | 35.44kb   |


### Comparison to Other RTE's

## Compatability

CAUTION: This chart is not up to chart. Testing will not be done until refactoring is complete.

        | Quirky    | Full Without Undo | Full      |
--------|-----------|-------------------|-----------|
Chrome  |         9 | 16                | 18        |
IE      |       N/A | 9                 | N/A       |
Firefox |         1 | 3.6               | 14        |
Safari  | Unknown   | Unknown           | 6         |
Opera   | Unknown   | Unknown           | 15        |


<commit_msg>Readme.<commit_after># Spytext - The Tiny But Fully Functional RTE for the Web

Currently very buggy, but only due to massive refactoring.  And more
refactoring is going to be needed. But soon. Ish.  Hopefully by the middle of
summer 2015 this will be ready in all of its glory.

And now for a quote to distract you from the mess.

Always the seer is a __sayer__. Somehow his dream is told: somehow he publishes it
with solemn joy: sometimes with pencil on canvas: sometimes with chisel on
stone; sometimes in towers and aisles of granite, his soul's worship is
builded; sometimes in anthems of indefinite music; but clearest and most
permanent, in words. 
- <NAME>

## Why ?

Simply because there are no other really good, bare-bone text editors using
`contentEditable`. Most browsers behave very differently in handling
line breaks, new blocks, backspaces, deletes, formatting etc. So basically
we have overriden all these actions with our own DOM manipulating actions.
The only things we use native actions for is actual typing and text traversal (arrow buttons,
page up, etc). Even the undo/redo has been completely replaced to allow us to modify
the DOM howerver we like, but still be able to go back to previous changes.
This might sound like a daunting task, but it turned out to be quite simple.
And thus it is also very small, just look below.

Current functions are styling text with italic, bold or underline. Change
between P, H1, H2, H3, H4, H5 and H6 blocks for text. Create ordered and
unordered lists and undo/redo (in the seperate module snapback).

## Spytext is Tiny

          | Minified  | Compressed
----------|-----------|-----------
Spytext   | 21kb      | 6.56kb    


## Compatability

        | Quirky    | Without Undo | Full      |
--------|-----------|--------------|-----------|
Chrome  |         9 | 16           | 18        |
IE      |       N/A | 9            | N/A       |
Firefox |         1 | 3.6          | 14        |
Safari  | Unknown   | Unknown      | 6         |
Opera   | Unknown   | Unknown      | 15        |


## Known Issues

Calling newline in a section that contains BR's might produce weird results. Especially
if there are trailing BR's.

Calling newline at end of list item with nested list and first list item in nested list
is empty also does weird things.

{'fraction_non_alphanumeric': 0.08931587837837837, 'fraction_numerical': 0.016258445945945946, 'mean_word_length': 2.420216606498195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7261310', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1254, 'n_words': 669}