You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by pm...@apache.org on 2015/02/27 08:03:18 UTC

incubator-corinthia git commit: enterPressed: Move cursor outside of note first

Repository: incubator-corinthia
Updated Branches:
  refs/heads/master 898122628 -> 3dfd8c86b


enterPressed: Move cursor outside of note first


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/3dfd8c86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/3dfd8c86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/3dfd8c86

Branch: refs/heads/master
Commit: 3dfd8c86b991d48dab62a84083cec6f2bea43c40
Parents: 8981226
Author: Peter Kelly <pe...@uxproductivity.com>
Authored: Fri Feb 27 14:02:25 2015 +0700
Committer: Peter Kelly <pe...@uxproductivity.com>
Committed: Fri Feb 27 14:02:25 2015 +0700

----------------------------------------------------------------------
 Editor/src/Cursor.js                            | 21 ++++++++++++++++++++
 .../cursor/enterPressed-endnote01-expected.html | 13 ++++++++++++
 .../cursor/enterPressed-endnote01-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote02-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote02-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote03-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote03-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote04-expected.html | 13 ++++++++++++
 .../cursor/enterPressed-endnote04-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote05-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote05-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote06-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote06-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote07-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote07-input.html    | 16 +++++++++++++++
 .../cursor/enterPressed-endnote08-expected.html | 12 +++++++++++
 .../cursor/enterPressed-endnote08-input.html    | 16 +++++++++++++++
 .../enterPressed-footnote01-expected.html       | 13 ++++++++++++
 .../cursor/enterPressed-footnote01-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote02-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote02-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote03-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote03-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote04-expected.html       | 13 ++++++++++++
 .../cursor/enterPressed-footnote04-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote05-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote05-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote06-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote06-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote07-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote07-input.html   | 16 +++++++++++++++
 .../enterPressed-footnote08-expected.html       | 12 +++++++++++
 .../cursor/enterPressed-footnote08-input.html   | 16 +++++++++++++++
 Editor/tests/index.js                           | 16 +++++++++++++++
 34 files changed, 489 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/src/Cursor.js
----------------------------------------------------------------------
diff --git a/Editor/src/Cursor.js b/Editor/src/Cursor.js
index e5ed0fc..377ca2a 100644
--- a/Editor/src/Cursor.js
+++ b/Editor/src/Cursor.js
@@ -654,6 +654,27 @@ var Cursor_insertEndnote;
             }
         }
 
+        // Are we inside a footnote or endnote? If so, move the cursor immediately after it
+        var note = null;
+        if (selRange.start.node.nodeType == Node.TEXT_NODE) {
+            note = Position_noteAncestor(selRange.start);
+        }
+        else {
+            // We can't use Position_noteAncestor in this case, because we want to to break
+            // the paragraph *before* the note, not after
+            var checkNode = selRange.start.node;
+            for (var anc = checkNode; anc != null; anc = anc.parentNode) {
+                if (isNoteNode(anc)) {
+                    note = anc;
+                    break;
+                }
+            }
+        }
+        if (note != null) {
+            var noteOffset = DOM_nodeOffset(note);
+            selRange = new Range(note.parentNode,noteOffset+1,note.parentNode,noteOffset+1);
+        }
+
         var check = Position_preferElementPosition(selRange.start);
         if (check.node.nodeType == Node.ELEMENT_NODE) {
             var before = check.node.childNodes[check.offset-1];

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote01-expected.html b/Editor/tests/cursor/enterPressed-endnote01-expected.html
new file mode 100644
index 0000000..a0c6787
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote01-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>before</p>
+    <p>
+      []
+      <span class="endnote"/>
+      after
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote01-input.html b/Editor/tests/cursor/enterPressed-endnote01-input.html
new file mode 100644
index 0000000..6291f6e
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote01-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before[]<span class="endnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote02-expected.html b/Editor/tests/cursor/enterPressed-endnote02-expected.html
new file mode 100644
index 0000000..3c70c9e
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote02-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote"></span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote02-input.html b/Editor/tests/cursor/enterPressed-endnote02-input.html
new file mode 100644
index 0000000..0349f77
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote02-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">[]</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote03-expected.html b/Editor/tests/cursor/enterPressed-endnote03-expected.html
new file mode 100644
index 0000000..a3966aa
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote03-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote"/>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote03-input.html b/Editor/tests/cursor/enterPressed-endnote03-input.html
new file mode 100644
index 0000000..ab48008
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote03-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote"></span>[]after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote04-expected.html b/Editor/tests/cursor/enterPressed-endnote04-expected.html
new file mode 100644
index 0000000..1664fb5
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote04-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>before</p>
+    <p>
+      []
+      <span class="endnote">endnote</span>
+      after
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote04-input.html b/Editor/tests/cursor/enterPressed-endnote04-input.html
new file mode 100644
index 0000000..e9e050e
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote04-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before[]<span class="endnote">endnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote05-expected.html b/Editor/tests/cursor/enterPressed-endnote05-expected.html
new file mode 100644
index 0000000..ad381c2
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote05-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote">endnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote05-input.html b/Editor/tests/cursor/enterPressed-endnote05-input.html
new file mode 100644
index 0000000..6a3b67f
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote05-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">[]endnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote06-expected.html b/Editor/tests/cursor/enterPressed-endnote06-expected.html
new file mode 100644
index 0000000..ad381c2
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote06-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote">endnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote06-input.html b/Editor/tests/cursor/enterPressed-endnote06-input.html
new file mode 100644
index 0000000..f13892f
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote06-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">end[]note</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote07-expected.html b/Editor/tests/cursor/enterPressed-endnote07-expected.html
new file mode 100644
index 0000000..ad381c2
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote07-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote">endnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote07-input.html b/Editor/tests/cursor/enterPressed-endnote07-input.html
new file mode 100644
index 0000000..c57b762
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote07-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">endnote[]</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote08-expected.html b/Editor/tests/cursor/enterPressed-endnote08-expected.html
new file mode 100644
index 0000000..ad381c2
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote08-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="endnote">endnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-endnote08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-endnote08-input.html b/Editor/tests/cursor/enterPressed-endnote08-input.html
new file mode 100644
index 0000000..79503c7
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-endnote08-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">endnote</span>[]after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote01-expected.html b/Editor/tests/cursor/enterPressed-footnote01-expected.html
new file mode 100644
index 0000000..3650dc8
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote01-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>before</p>
+    <p>
+      []
+      <span class="footnote"/>
+      after
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote01-input.html b/Editor/tests/cursor/enterPressed-footnote01-input.html
new file mode 100644
index 0000000..7d1d2a2
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote01-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before[]<span class="footnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote02-expected.html b/Editor/tests/cursor/enterPressed-footnote02-expected.html
new file mode 100644
index 0000000..5f52e4d
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote02-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote"></span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote02-input.html b/Editor/tests/cursor/enterPressed-footnote02-input.html
new file mode 100644
index 0000000..0ee7ad4
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote02-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">[]</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote03-expected.html b/Editor/tests/cursor/enterPressed-footnote03-expected.html
new file mode 100644
index 0000000..b9ab906
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote03-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote"/>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote03-input.html b/Editor/tests/cursor/enterPressed-footnote03-input.html
new file mode 100644
index 0000000..f2e61c0
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote03-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote"></span>[]after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote04-expected.html b/Editor/tests/cursor/enterPressed-footnote04-expected.html
new file mode 100644
index 0000000..31207ea
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote04-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>before</p>
+    <p>
+      []
+      <span class="footnote">footnote</span>
+      after
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote04-input.html b/Editor/tests/cursor/enterPressed-footnote04-input.html
new file mode 100644
index 0000000..1c23e5e
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote04-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before[]<span class="footnote">footnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote05-expected.html b/Editor/tests/cursor/enterPressed-footnote05-expected.html
new file mode 100644
index 0000000..62280e9
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote05-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote">footnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote05-input.html b/Editor/tests/cursor/enterPressed-footnote05-input.html
new file mode 100644
index 0000000..78dc232
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote05-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">[]footnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote06-expected.html b/Editor/tests/cursor/enterPressed-footnote06-expected.html
new file mode 100644
index 0000000..62280e9
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote06-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote">footnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote06-input.html b/Editor/tests/cursor/enterPressed-footnote06-input.html
new file mode 100644
index 0000000..c7d159c
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote06-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">foot[]note</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote07-expected.html b/Editor/tests/cursor/enterPressed-footnote07-expected.html
new file mode 100644
index 0000000..62280e9
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote07-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote">footnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote07-input.html b/Editor/tests/cursor/enterPressed-footnote07-input.html
new file mode 100644
index 0000000..e6777ad
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote07-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">footnote[]</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote08-expected.html b/Editor/tests/cursor/enterPressed-footnote08-expected.html
new file mode 100644
index 0000000..62280e9
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote08-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="../generic.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <p>
+      before
+      <span class="footnote">footnote</span>
+    </p>
+    <p>[]after</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/cursor/enterPressed-footnote08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/cursor/enterPressed-footnote08-input.html b/Editor/tests/cursor/enterPressed-footnote08-input.html
new file mode 100644
index 0000000..50f1986
--- /dev/null
+++ b/Editor/tests/cursor/enterPressed-footnote08-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../generic.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    Cursor_enterPressed();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">footnote</span>[]after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3dfd8c86/Editor/tests/index.js
----------------------------------------------------------------------
diff --git a/Editor/tests/index.js b/Editor/tests/index.js
index 56b8db2..cdaa445 100644
--- a/Editor/tests/index.js
+++ b/Editor/tests/index.js
@@ -403,8 +403,24 @@ var tests = [
             "enterPressed-emptyContainer07a",
             "enterPressed-emptyContainer08",
             "enterPressed-emptyContainer08a",
+            "enterPressed-endnote01",
+            "enterPressed-endnote02",
+            "enterPressed-endnote03",
+            "enterPressed-endnote04",
+            "enterPressed-endnote05",
+            "enterPressed-endnote06",
+            "enterPressed-endnote07",
+            "enterPressed-endnote08",
             "enterPressed-figcaption01",
             "enterPressed-figcaption02",
+            "enterPressed-footnote01",
+            "enterPressed-footnote02",
+            "enterPressed-footnote03",
+            "enterPressed-footnote04",
+            "enterPressed-footnote05",
+            "enterPressed-footnote06",
+            "enterPressed-footnote07",
+            "enterPressed-footnote08",
             "enterPressed-heading01",
             "enterPressed-heading02",
             "enterPressed-heading03",