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
7 changes: 0 additions & 7 deletions css/prosemirror.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ div.ProseMirror {
}
}

&[contenteditable=true],
[contenteditable=true] {
* {
-webkit-user-modify: read-write-plaintext-only;
}
}

.checkbox-item {
display: flex;
align-items: start;
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/MenuBar.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { initUserAndFiles, randHash } from '../utils/index.js'

const randUser = randHash()
const fileName = 'test.md'
const fileName = 'empty.md'

describe('Test the rich text editor menu bar', function() {
before(() => initUserAndFiles(randUser, fileName))
Expand Down
30 changes: 24 additions & 6 deletions cypress/e2e/mentions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ const randUser = randHash()
const randUser1 = randHash()
const currentUser = randUser

const fileName = 'empty.md'

const refresh = () => {
cy.get('.files-controls .crumb:not(.hidden) a')
.last()
.click({ force: true })
}

const createFileWithMention = (target, userToMention) => {
const mimeType = 'text/markdown'
const content = `Hello @[${userToMention}](mention://user/${userToMention})`
cy.createFile(target, content, mimeType)
cy.createFile(target, content)
.then(refresh)
}

Expand All @@ -32,9 +33,17 @@ describe('Test mentioning users', () => {
const requestAlias = 'fetchUsersList'
cy.intercept({ method: 'POST', url: '**/users' }).as(requestAlias)

cy.openFile('test.md')
cy.get('.text-editor__content div[contenteditable="true"]')
.clear()
cy.isolateTest({
sourceFile: fileName,
onBeforeLoad(win) {
cy.stub(win, 'open')
.as('winOpen')
},
})

cy.openFile(fileName, { force: true })

cy.getContent()
.type(`@${randUser1.substring(0, 3)}`)

return cy.wait(`@${requestAlias}`)
Expand All @@ -51,7 +60,16 @@ describe('Test mentioning users', () => {
const autocompleteReauestAlias = 'fetchUsersList'
cy.intercept({ method: 'POST', url: '**/users' }).as(autocompleteReauestAlias)

cy.openFile('test.md')
cy.isolateTest({
sourceFile: fileName,
onBeforeLoad(win) {
cy.stub(win, 'open')
.as('winOpen')
},
})

cy.openFile(fileName, { force: true })

cy.get('.text-editor__content div[contenteditable="true"]')
.clear()
.type(`@${randUser1.substring(0, 3)}`)
Expand Down
21 changes: 13 additions & 8 deletions cypress/e2e/sections.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { initUserAndFiles, randHash } from '../utils/index.js'

const currentUser = randHash()
const fileName = 'test.md'
const fileName = 'empty.md'

const refresh = () => cy.get('.files-controls .crumb:not(.hidden) a')
.last()
Expand All @@ -28,13 +28,19 @@ describe('Content Sections', () => {
},
})

cy.openFile(fileName)
.then(() => cy.clearContent())
cy.isolateTest({
sourceFile: fileName,
onBeforeLoad(win) {
cy.stub(win, 'open')
.as('winOpen')
},
})

cy.openFile(fileName, { force: true })
return cy.clearContent()
})

describe('Heading anchors', () => {
beforeEach(() => cy.clearContent())

it('Anchor exists', () => {
cy.getContent()
.type('# Heading\nText\n## Heading 2\nText\n## Heading 2')
Expand Down Expand Up @@ -120,7 +126,8 @@ describe('Content Sections', () => {
})
cy.then(() => {
cy.getContent()
.type('{selectAll}')
.find('h1 [data-node-view-content] span')
.click({ force: true, position: 'center' })
.then(() => {
cy.getActionEntry('headings')
.click()
Expand All @@ -136,8 +143,6 @@ describe('Content Sections', () => {
})

describe('Table of Contents', () => {
beforeEach(() => cy.clearContent())

it('sidebar toc', () => {
cy.getContent()
.type('# T1 \n## T2 \n### T3 \n#### T4 \n##### T5 \n###### T6\n')
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Cypress.Commands.add('uploadFile', (fileName, mimeType, target) => {
})
})

Cypress.Commands.add('createFile', (target, content, mimeType) => {
Cypress.Commands.add('createFile', (target, content, mimeType = 'text/markdown') => {
const fileName = target.split('/').pop()

const blob = new Blob([content], { type: mimeType })
Expand Down
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/nodes/Heading/HeadingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
<template>
<NodeViewWrapper :id="node.attrs.id"
ref="container"
:as="domElement"
tabindex="-1">
:as="domElement">
<a aria-hidden="true"
class="heading-anchor"
:href="href"
:title="t('text', 'Link to this section')"
:contenteditable="false"
@click.stop="click">{{ linkSymbol }}</a>
<NodeViewContent />
<NodeViewContent as="span" />
</NodeViewWrapper>
</template>

Expand Down