File tree 2 files changed +20
-2
lines changed
lib/qiita/markdown/filters
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module Filters
8
8
class Mention < HTML ::Pipeline ::MentionFilter
9
9
MentionPattern = /
10
10
(?:^|\W )
11
- @((?>[\w ][\w -]{1 ,30}\w (?:@github)?))
11
+ @((?>[\w ][\w -]{0 ,30}\w (?:@github)?))
12
12
(?!\/ )
13
13
(?=
14
14
\. +[ \t \W ]|
Original file line number Diff line number Diff line change 241
241
end
242
242
end
243
243
244
+ context "with mention to short name user" do
245
+ let ( :markdown ) do
246
+ "@al"
247
+ end
248
+
249
+ it "replaces mention with link" do
250
+ should include ( <<-EOS . strip_heredoc . rstrip )
251
+ <a href="/al" class="user-mention" title="al">@al</a>
252
+ EOS
253
+ end
254
+ end
255
+
244
256
context "with mentions in complex patterns" do
245
257
let ( :markdown ) do
246
258
<<-EOS . strip_heredoc
258
270
@justin
259
271
@mallory@github
260
272
@#{ 'o' * 33 }
261
- @oo
273
+ @o
274
+ @o-
275
+ @-o
276
+ @o_
277
+ @_o
262
278
EOS
263
279
end
264
280
271
287
Isaac
272
288
justin
273
289
mallory@github
290
+ o_
291
+ _o
274
292
]
275
293
end
276
294
end
You can’t perform that action at this time.
0 commit comments