File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
app/assets/javascripts/discourse
app/static/prosemirror/extensions
tests/integration/components/prosemirror-editor Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,20 @@ const extension = {
76
76
state . linkMarkup = mark . attrs . markup ;
77
77
78
78
if ( state . linkMarkup === "autolink" ) {
79
+ state . inAutolink = true ;
79
80
return "<" ;
80
81
}
81
82
82
83
if ( state . linkMarkup === "linkify" ) {
84
+ state . inAutolink = true ;
83
85
return "" ;
84
86
}
85
87
86
88
return "[" ;
87
89
} ,
88
90
close ( state , mark ) {
91
+ state . inAutolink = false ;
92
+
89
93
const { linkMarkup } = state ;
90
94
state . linkMarkup = undefined ;
91
95
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ module(
23
23
'<p><a href="https://example.com" data-markup="autolink">https://example.com</a></p>' ,
24
24
"<https://example.com>" ,
25
25
] ,
26
+ "auto links with ~" : [
27
+ "<https://example.com/~user> https://example.com/~user" ,
28
+ '<p><a href="https://example.com/~user" data-markup="autolink">https://example.com/~user</a> <a href="https://example.com/~user" data-markup="linkify">https://example.com/~user</a></p>' ,
29
+ "<https://example.com/~user> https://example.com/~user" ,
30
+ ] ,
26
31
"attachment link" : [
27
32
"[File|attachment](https://example.com/file.pdf)" ,
28
33
'<p><a href="https://example.com/file.pdf" class="attachment">File</a></p>' ,
You can’t perform that action at this time.
0 commit comments