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
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/dist/style.css" />
<style>
@import url('https://nextcloud.github.io/server/apps/theming/css/default.css');
@import url('https://nextcloud.github.io/server/core/css/server.css');
body {
position: absolute;
height: unset;
background-color: var(--color-main-background);
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test the package</title>
</head>
Expand All @@ -15,7 +24,8 @@
return string
}
OC = {
webroot: '/OC_WEBROOT',
webroot: '/dist/OC_WEBROOT',
config: {},
isUserAdmin() {
return true
}
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.

20 changes: 11 additions & 9 deletions src/EditorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@ const createEditor = ({ content, onCreate, onUpdate, extensions, enableRichEditi
richEditingExtensions = [
Markdown,
RichText.configure({
extensions: [EditableTable],
extensions: [
EditableTable,
Mention.configure({
HTMLAttributes: {
class: 'mention',
},
suggestion: MentionSuggestion({
session,
}),
}),
],
}),
Emoji.configure({
suggestion: {
Expand Down Expand Up @@ -116,14 +126,6 @@ const createEditor = ({ content, onCreate, onUpdate, extensions, enableRichEditi
},
},
}),
Mention.configure({
HTMLAttributes: {
class: 'mention',
},
suggestion: MentionSuggestion({
session,
}),
}),
Placeholder.configure({
emptyNodeClass: 'is-empty',
placeholder: t('text', 'Add notes, lists or links …'),
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/Mention.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
},
computed: {
isCurrentUser() {
return this.node.attrs.id === getCurrentUser().uid
return this.node.attrs.id === getCurrentUser()?.uid
},
},
}
Expand Down
6 changes: 6 additions & 0 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import BulletList from './../nodes/BulletList.js'
import TaskList from './../nodes/TaskList.js'
import TaskItem from './../nodes/TaskItem.js'
import Callout from './../nodes/Callouts.js'
import Mention from './../extensions/Mention.js'
/* eslint-enable import/no-named-as-default */

import { Strong, Italic, Strike, Link, Underline } from './../marks/index.js'
Expand Down Expand Up @@ -91,6 +92,11 @@ export default Extension.create({
Dropcursor,
KeepSyntax,
FrontMatter,
Mention.configure({
HTMLAttributes: {
class: 'mention',
},
}),
]
if (this.options.link !== false) {
defaultExtensions.push(Link.configure({
Expand Down
2 changes: 2 additions & 0 deletions src/tests/fixtures/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
|table| heading| row|
| --- | --- | --- |
|first| body| row|

@[user](mention://user/user)