motion-markdown-it 4.1.0.1 → 4.1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/motion-markdown-it/index.rb +9 -9
- data/lib/motion-markdown-it/version.rb +1 -1
- data/spec/motion-markdown-it/misc_spec.rb +14 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 214800d2799b974abec953888695a55f613bf244
|
4
|
+
data.tar.gz: 16fed8197c4f45298e8afe3994ff701c49bf3b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a7c3eb82df1344805e860c58ad815618cbbe727a2cbd42350687d6c559a7bf7b6672f70f22d5234bbf679fc10896263192f6e617899663d7dfb0967b273c88
|
7
|
+
data.tar.gz: 357565490abb891b1bf6cc3d5b31240aa8b0da3c6e8f512e9440276bfcd750676c634989c76abe8db96109c86d207fe7b215526b0919535eac70f823d4870d1e
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Ruby/RubyMotion version of Markdown-it (CommonMark compliant and extendable)
|
6
6
|
|
7
|
-
This gem is a port of the [markdown-it Javascript package](https://github.com/markdown-it/markdown-it) by Vitaly Puzrin and Alex Kocharin. Currently synced with markdown-it 4.0
|
7
|
+
This gem is a port of the [markdown-it Javascript package](https://github.com/markdown-it/markdown-it) by Vitaly Puzrin and Alex Kocharin. Currently synced with markdown-it 4.1.0
|
8
8
|
|
9
9
|
__[Javascript Live demo](https://markdown-it.github.io)__
|
10
10
|
|
@@ -407,20 +407,20 @@ module MarkdownIt
|
|
407
407
|
# chainable
|
408
408
|
# MarkdownIt.use(plugin, params)
|
409
409
|
#
|
410
|
-
# Load specified plugin with given params into current parser
|
411
|
-
# It's just a sugar to call `plugin(md, params)`
|
410
|
+
# Initialize and Load specified plugin with given params into current parser
|
411
|
+
# instance. It's just a sugar to call `plugin.init_plugin(md, params)`
|
412
412
|
#
|
413
413
|
# ##### Example
|
414
414
|
#
|
415
|
-
# ```
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
415
|
+
# ```ruby
|
416
|
+
# md = MarkdownIt::Parser.new
|
417
|
+
# md.use(MDPlugin::Iterator, 'foo_replace', 'text',
|
418
|
+
# lambda {|tokens, idx|
|
419
|
+
# tokens[idx].content = tokens[idx].content.gsub(/foo/, 'bar')
|
420
|
+
# })
|
421
421
|
# ```
|
422
422
|
def use(plugin, *args)
|
423
|
-
plugin.
|
423
|
+
plugin.init_plugin(self, *args)
|
424
424
|
return self
|
425
425
|
end
|
426
426
|
|
@@ -26,17 +26,23 @@ describe 'API' do
|
|
26
26
|
}.to raise_error
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
it 'plugin' do
|
29
|
+
class TestPlugin
|
31
30
|
@success = false
|
32
|
-
|
31
|
+
def self.init_plugin(md, options)
|
32
|
+
@success = true if (options == 'bar')
|
33
|
+
end
|
34
|
+
def self.success
|
35
|
+
@success
|
36
|
+
end
|
37
|
+
end
|
33
38
|
|
39
|
+
#------------------------------------------------------------------------------
|
40
|
+
it 'plugin' do
|
34
41
|
md = MarkdownIt::Parser.new
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
expect(@success).to eq true
|
42
|
+
md.use(TestPlugin, 'foo')
|
43
|
+
expect(TestPlugin.success).to eq false
|
44
|
+
md.use(TestPlugin, 'bar')
|
45
|
+
expect(TestPlugin.success).to eq true
|
40
46
|
end
|
41
47
|
|
42
48
|
#------------------------------------------------------------------------------
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-markdown-it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.0.
|
4
|
+
version: 4.1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Walker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-04-
|
13
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mdurl-rb
|