qiita-markdown 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 400a8d14ddb12519af903529d33edc4fde64b896
4
- data.tar.gz: 9dc0960652c433e62e7b7f5b760905b13becc82a
3
+ metadata.gz: 6b66602727857672deb15686f30a84459ca8abc8
4
+ data.tar.gz: 42d96b87ea9bd7ab22e26b6fcbecccad751f2bf3
5
5
  SHA512:
6
- metadata.gz: b948ada8128ad2cbd8aa59018b651a4f48839ab385f62d86da5d1b8acf27141178cbcd40f2831c269d3b1c00d240f4740c03ff769ed49746306483a71d935a1e
7
- data.tar.gz: a51d471e58496f7c593ab59fd90add803991b7dffe834b59b66893f1edc3bf81984a1e8b4bb85dd9cb9a2a317c9865f316c9e28c39c97ecb5966f4a86f5aa6e5
6
+ metadata.gz: 76e646fabb486443f85395a54821e2b64b6f241ecb4da4ef2bccd4f364b4e33cdc77a457a7523b798bfe90dfe9c4b90472e50e17bed58d4c885bb5a1fb242eb4
7
+ data.tar.gz: 8548756ff8d170d01abb8476af73bc4521b0b37e5c811cadab45cda9b79f7ba5a25f22af334bca7f643bcba8a5040a875e43f4089ccbbf6210f137c2259179bb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.7.1
2
+ - Support mentions to 2-character usernames
3
+
1
4
  ## 0.7.0
2
5
  - Support `@all`
3
6
 
@@ -8,7 +8,7 @@ module Qiita
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]|
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
4
4
  end
5
5
  end
@@ -241,6 +241,18 @@ describe Qiita::Markdown::Processor do
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,7 +270,11 @@ describe Qiita::Markdown::Processor do
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,6 +287,8 @@ describe Qiita::Markdown::Processor do
271
287
  Isaac
272
288
  justin
273
289
  mallory@github
290
+ o_
291
+ _o
274
292
  ]
275
293
  end
276
294
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport