![]() |
Ender HTML Typing RulesThe document on writing new rule sets is here.
Space Rules:"Word" refers to any run of non-whitespace characters. All sorts of things count as non-whitespace characters, including inline images and nbsp's. Whitespace is a space, tab, or newline (plus a funky zero-width whitespace character).
In the tab rules, N is the tab width, which is based on a user pref.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
| collapsed; in a table cell other than the last | set selection to next table cell |
| collapsed; in the last table cell | insert new table row and set selection to first cell in last row |
| collapsed; in a block with style white-space: PRE | tab inserted |
| collapsed; in the middle of a word | insert N-1 nbsp's followed by a space |
| collapsed; after a word and before whitespace | insert N nbsp's |
| collapsed; after whitespace before a word | existing space replaced with N nbsp's+space |
| collapsed; surrounded by whitespace | insert N nbsp's |
| non-collapsed; no portion of table selected | delete selection then apply collapsed selection rule |
| non-collapsed; inside single table cell | as if collapsed selection in that cell |
| non-collapsed; not contained in single table cell | do nothing |
| not covered by above | insert N nbsp's |
|
|
|
| Block parent has white-space: PRE | insert a newline character |
| Block parent is {OL,UL} | close any <LI> we are in, insert new <LI> |
| Block parent is <DL> | if in <DT>, close <DT> and insert <DD>
if in <DD> insert <BR> else insert a <DT> |
| Block parent is one of: {H1, ... H6} | close block |
| Block parent is one of: {P, BODY, DIV, NOSCRIPT, BLOCKQUOTE, ADDRESS}
no <BR> tags are adjacent to insertion point |
insert a <BR> |
| Block parent is <P>
a <BR> tag is adjacent to insertion point |
remove <BR> then split <P>, with contents before insertion point in first <P> and the rest in the second <P> |
| Block parent is one of {BODY, DIV, NOSCRIPT, BLOCKQUOTE, ADDRESS}
a <BR> tag is adjacent to insertion point |
remove <BR> and insert <P> |
| not covered by above | insert a <BR> |
|
|
|
| after a nbsp-space combination (in same block parent) | replace nbsp-space with space |
| after non-whitespace (in same block parent) | delete previous character |
| after the close of <TABLE> | do nothing |
| between <TD>s, or at beginning of <TD> | do nothing |
| after close of {HR, IMG, BR, MAP, OBJECT, form element} | delete element |
| after close of {DIV, BLOCKQUOTE, NOSCRIPT, ADDRESS, FORM} | pretend you are in same block, i.e., text inside these counts as if it were in your same block for deletion purposes |
| after </P><P> | join <P>s, insert <BR> |
| between two like elements that are one of {H*,LI} | join elements |
| not covered by above | do nothing |
Forward delete rules will be similar to backspace rules (only deleting forwards, of course).
If you backspace/delete completely through an inline block, that block will be removed. But the editor will remember the "typing style" of your cursor location, so if you backspace up to the last character of, say, a <b> tag, but no further, and then type again, the <b> will be reinserted and text you type will be bold (modulo your style sheet).
The HTML editor is not style sheet savvy and no plans are made for any of the typing rules to use style to make rules decisions except for the determination of the white-space: PRE style.