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
18 changes: 9 additions & 9 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.

2 changes: 1 addition & 1 deletion js/files.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/public.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/EditorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
HardBreak,
Heading,
Code,
Link,
BulletList,
OrderedList,
Blockquote,
Expand All @@ -34,7 +33,7 @@ import {
History,
Placeholder,
} from 'tiptap-extensions'
import { Strong, Italic, Strike } from './marks'
import { Strong, Italic, Strike, Link } from './marks'
import { Image, PlainTextDocument, ListItem } from './nodes'
import MarkdownIt from 'markdown-it'
import taskLists from 'markdown-it-task-lists'
Expand Down
31 changes: 30 additions & 1 deletion src/marks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import { Bold, Italic as TipTapItalic, Strike as TipTapStrike } from 'tiptap-extensions'
import { Bold, Italic as TipTapItalic, Strike as TipTapStrike, Link as TipTapLink } from 'tiptap-extensions'

/**
* This file maps prosemirror mark names to tiptap classes,
Expand Down Expand Up @@ -74,10 +74,39 @@ class Strike extends TipTapStrike {

}

class Link extends TipTapLink {

get schema() {
return {
attrs: {
href: {
default: null,
},
},
inclusive: false,
parseDOM: [
{
tag: 'a[href]',
getAttrs: dom => ({
href: dom.getAttribute('href'),
}),
},
],
toDOM: node => ['a', {
...node.attrs,
title: node.attrs.href,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is the only difference to the tiptap implementation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rel: 'noopener noreferrer nofollow',
}, 0],
}
}

}

/** Strike is currently unsupported by prosemirror-markdown */

export {
Strong,
Italic,
Strike,
Link,
}