Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions css/prosemirror.scss
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ div.ProseMirror {
}

.editor__content p.is-empty:first-child::before {
content: attr(data-empty-text);
content: attr(data-placeholder);
float: left;
color: var(--color-text-maxcontrast);
pointer-events: none;
height: 0;
}

.editor__content {
tab-size: 4;
.editor__content {
tab-size: 4;
}
67 changes: 67 additions & 0 deletions cypress/integration/ListItem.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import BulletList from './../../src/nodes/BulletList'
import ListItem from './../../src/nodes/ListItem'
import Markdown from './../../src/extensions/Markdown';
import { findChildrenByType } from 'prosemirror-utils'
import createEditor from './../../src/tests/createEditor'

describe('ListItem extension integrated in the editor', () => {

it('has attrs', () => {
const editor = createEditor({
content: '<p><ul><li>Test</li></ul></p>',
extensions: [Markdown, BulletList, ListItem]
})
const li = findListItem(editor)
expect(li.attrs).to.deep.eq({done: null, type: 0})
})

it('creates todo lists', () => {
const editor = createEditor({
content: '<p>Test</p>',
extensions: [Markdown, BulletList, ListItem]
})
editor.chain().todo_item().run()
const li = findListItem(editor)
expect(li.attrs).to.deep.eq({done: false, type: 1})
})

it('removes the list when toggling todo off', () => {
const editor = createEditor({
content: '<p>Test</p>',
extensions: [Markdown, BulletList, ListItem]
})
editor.chain().todo_item().run()
editor.chain().todo_item().run()
expect(findListItem(editor)).to.eq(undefined)
})

it('turns a bullet list into a todo list', () => {
const editor = createEditor({
content: '<p>Test</p>',
extensions: [Markdown, BulletList, ListItem]
})
editor.chain().bulletListItem().run()
editor.chain().todo_item().run()
const li = findListItem(editor)
expect(li.attrs).to.deep.eq({done: false, type: 1})
})

it('only toggles one list item', () => {
const editor = createEditor({
content: '<p><ul><li>Todo</li><li>Not to do</li></ul></p>',
extensions: [Markdown, BulletList, ListItem]
})
editor.chain().todo_item().run()
const todo = findListItem(editor, 0)
const li = findListItem(editor, 1)
expect(todo.attrs).to.deep.eq({done: false, type: 1})
expect(li.attrs).to.deep.eq({done: null, type: 0})
})

})

function findListItem(editor, index = 0) {
const doc = editor.state.doc
const type = editor.schema.nodes.listItem
return findChildrenByType(doc, type)[index]?.node;
}
3 changes: 0 additions & 3 deletions cypress/integration/share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ describe('Open test.md in viewer', function() {
return false
})

cy.get('#fileList tr[data-file="welcome.txt"]', {timeout: 10000})
.should('contain', 'welcome.txt')

// Upload test files
cy.createFolder('folder')
cy.uploadFile('test.md', 'text/markdown', 'folder/test.md')
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ describe('Workspace', function() {
.type('Format me')
.type('{selectall}')
;[
['bold', 'strong'],
['italic', 'em'],
['underline', 'u'],
['bold', 'strong'],
['italic', 'em'],
['underline', 'u'],
['strike', 's']
].forEach(([button, tag]) => {
menuButton(button)
Expand Down
4 changes: 2 additions & 2 deletions js/editor-collab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-collab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions js/editor.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
* @copyright Copyright (c) 2019 Azul <[email protected]>
*
* @author Azul <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/*
* @copyright Copyright (c) 2019 Julius Härtl <[email protected]>
*
Expand Down Expand Up @@ -42,6 +64,28 @@
*
*/

/*
* @copyright Copyright (c) 2019 Julius Härtl <[email protected]>
*
* @author Julius Härtl <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/*
* @copyright Copyright (c) 2020 Azul <[email protected]>
*
Expand Down Expand Up @@ -129,3 +173,32 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/*
* @copyright Copyright (c) 2021, überdosis GbR
*
* @license MIT
*
*/

/*
* @copyright Copyright (c) 2022 Max <[email protected]>
*
* @author Max <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/highlight/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading