gyazz-markup 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3604dcb701cdcc745821cd93eba990f766af7d9
4
- data.tar.gz: adec3550f1f4825773a7acd621ad4a66dcca123e
3
+ metadata.gz: 5289a380b8892bbcadbb80a9e362ac8e13747f46
4
+ data.tar.gz: 234041925dcab83752cd64b371d32c473b050994
5
5
  SHA512:
6
- metadata.gz: b5cb1dfa1c6f411a440c527d7e48cf6dae3d505ca54ece2be80e607bb9bd027024dcbbaa2ba936507263a31e58813044c8376b3167a76878cd2e8fc529013a60
7
- data.tar.gz: 598c0d654f2b642d3c016ba061f0ff4aa6613d26c9aa65518799a83c1af914afc8e96f939d03d75a4ae19634d9b0ad89919e9fa6be3436413a903789d6ea5f20
6
+ metadata.gz: 060e6ac969ad1360659415c5c72267f3bbe3aab52e0e54de9a309446dcbc26905833aef9436994d2efab30491783ad9b8009eea9541b6c2b45c17257f5703f0c
7
+ data.tar.gz: b6e3c55232a071633173c4ea012de9eab98357f2a2c933fd28cf1934b0985692b683f9f82ce750a0752baf669f3cfb508d777529f14e48e6a75d1bd31480910c
data/.gitignore CHANGED
@@ -7,7 +7,6 @@
7
7
  .bundle
8
8
  .config
9
9
  .yardoc
10
- Gemfile.lock
11
10
  InstalledFiles
12
11
  _yardoc
13
12
  coverage
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.1 2013-04-08
2
+
3
+ * link WikiName::PageName
4
+
1
5
  === 0.1.0 2013-04-07
2
6
 
3
7
  * add samples
data/README.md CHANGED
@@ -3,6 +3,7 @@ gyazz-markup
3
3
  convert Gyazz.com syntax to HTML.
4
4
 
5
5
  * https://github.com/shokai/gyazz-markup
6
+ * http://gyazz.com/増井/Gyazz記法
6
7
 
7
8
 
8
9
  Installation
@@ -26,6 +26,7 @@ module GyazzMarkup
26
26
  line = markup_strong line
27
27
  line = markup_url_with_title line
28
28
  line = markup_url line
29
+ line = markup_wiki_link line
29
30
  line = markup_inner_link line
30
31
  end
31
32
  end
@@ -45,6 +46,11 @@ module GyazzMarkup
45
46
  str !~ pat ? str : str.gsub(pat, "<a href=\"#{options[:host]}/#{options[:wiki]}/#{$1}\">#{$1}</a>")
46
47
  end
47
48
 
49
+ def markup_wiki_link(str)
50
+ pat = /\[{2}([^\/]+)::(.+)\]{2}/
51
+ str !~ pat ? str : str.gsub(pat, "<a href=\"#{options[:host]}/#{$1}/\">#{$1}</a>::<a href=\"#{options[:host]}/#{$1}/#{$2}\">#{$2}</a>")
52
+ end
53
+
48
54
  def markup_strong(str)
49
55
  pat = /\[{3}(.+)\]{3}/
50
56
  str !~ pat ? str : str.gsub(pat, "<strong>#{$1}</strong>")
@@ -1,3 +1,3 @@
1
1
  module GyazzMarkup
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/samples/sample.txt CHANGED
@@ -4,6 +4,7 @@
4
4
  URLをリンク [[http://shokai.org]]
5
5
  タイトル付きURLリンク → [[htts:/example.com 私のホームページ]]
6
6
  画像つきURLリンク [[https://shokai.org http://gyazo.com/b2c551db20c7ef6ad598b89e66be6517.png]]
7
+ wikilink [[WikiName::PageName]]
7
8
  インデント
8
9
  aaa
9
10
  aaa1
@@ -42,6 +42,11 @@ class TestGyazzMarkup < MiniTest::Unit::TestCase
42
42
  assert gm.markup_inner_link("[[foo bar]]") == "<a href=\"http://mygyazz.com/shokai/foo bar\">foo bar</a>", "inner link with gyazz-name"
43
43
  end
44
44
 
45
+ def test_markup_wiki_link
46
+ assert @gm.markup_wiki_link("[[WikiName::PageName]]") == "<a href=\"http://gyazz.com/WikiName/\">WikiName</a>::<a href=\"http://gyazz.com/WikiName/PageName\">PageName</a>"
47
+ assert @gm.markup_wiki_link("[[Wiki Name::Page Name]]") == "<a href=\"http://gyazz.com/Wiki Name/\">Wiki Name</a>::<a href=\"http://gyazz.com/Wiki Name/Page Name\">Page Name</a>"
48
+ end
49
+
45
50
  def test_markup_strong
46
51
  assert @gm.markup_strong("[[[foo]]]") == "<strong>foo</strong>", "strong"
47
52
  assert @gm.markup_strong("[[[foo bar baz]]]") == "<strong>foo bar baz</strong>", "strong with space"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyazz-markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto