Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax <max@nextcloud.com>2022-03-16 13:07:31 +0300
committerMax <max@nextcloud.com>2022-03-31 15:29:22 +0300
commitdf1deb6c36b42e4dee065742e5791afe95f04f5d (patch)
tree7c452cc94d3ca955c7114f72db330ac111ff0b12 /cypress
parent230dba77c564cdafb5c0a32c4b5c000d605ef1c3 (diff)
fix: preserve td and th attributes
Prosemirror expects colspan, rowspan and the like to calculate the table layout. Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/fixtures/Table.md60
-rw-r--r--cypress/integration/Table.spec.js12
2 files changed, 66 insertions, 6 deletions
diff --git a/cypress/fixtures/Table.md b/cypress/fixtures/Table.md
index 634544249..546ecb189 100644
--- a/cypress/fixtures/Table.md
+++ b/cypress/fixtures/Table.md
@@ -52,3 +52,63 @@ insertTable
did insertTable
+## Add a new row at the end
+
+| | | |
+|--|--|--|
+| | | |
+| | | addRowAfter |
+
+
+---
+
+| | | |
+|--|--|--|
+| | | |
+| | | did addRowAfter |
+| | | |
+
+## Add a new column at the end
+
+| | | |
+|--|--|--|
+| | | |
+| | | addColumnAfter |
+
+
+---
+
+| | | | |
+|--|--|--|--|
+| | | | |
+| | | did addColumnAfter | |
+
+## Delete row at the end
+
+| | | |
+|--|--|--|
+| | | |
+| | | deleteRow |
+
+
+---
+
+| | | |
+|--|--|--|
+| | | |
+
+## Delete column at the end
+
+| | | |
+|--|--|--|
+| | | |
+| | | deleteColumn |
+
+
+---
+
+| | |
+|--|--|
+| | |
+| | |
+
diff --git a/cypress/integration/Table.spec.js b/cypress/integration/Table.spec.js
index a04601123..cbf38f86d 100644
--- a/cypress/integration/Table.spec.js
+++ b/cypress/integration/Table.spec.js
@@ -1,9 +1,8 @@
import Table from './../../src/nodes/Table'
-import TableBody from './../../src/nodes/TableBody'
import TableCell from './../../src/nodes/TableCell'
-import TableHead from './../../src/nodes/TableHead'
import TableHeader from './../../src/nodes/TableHeader'
import TableRow from './../../src/nodes/TableRow'
+import TableHeadRow from './../../src/nodes/TableHeadRow'
import Markdown from './../../src/extensions/Markdown'
import markdownit from './../../src/markdownit'
import { createMarkdownSerializer } from './../../src/extensions/Markdown';
@@ -18,10 +17,9 @@ describe('ListItem extension integrated in the editor', () => {
extensions: [
Markdown,
Table,
- TableBody,
TableCell,
- TableHead,
TableHeader,
+ TableHeadRow,
TableRow,
],
})
@@ -53,8 +51,10 @@ describe('ListItem extension integrated in the editor', () => {
editor.commands.setTextSelection(found.pos)
editor.commands[name]()
const updated = findCommand()
- editor.commands.setTextSelection(updated.pos)
- editor.commands.insertContent('did ')
+ if (updated) {
+ editor.commands.setTextSelection(updated.pos)
+ editor.commands.insertContent('did ')
+ }
}
}