extended-markdown-filter 0.3.0 → 0.3.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: 60df9d0ebe97519c31fe1f520a9c658cbd32cf93
4
- data.tar.gz: 67ec9948aa8298368c111d4da11ecbf497a74fa0
3
+ metadata.gz: 5e39736b7db330ed79b07670dfe2700318ecb02a
4
+ data.tar.gz: 0026e0d7a541c4724d93d4f115dca0a333e3056d
5
5
  SHA512:
6
- metadata.gz: 8778d83a3f69f24d3d5a403f99059408f5818ae0e140ff51e057d388c5a4377cf7649de55c2dd59c26d7da22cfa72f62d7375eac1a4682b4370151e2c6ec717e
7
- data.tar.gz: 3959bc0a0c111971292dba01716ca020494445543d66b53527071941e006398efbee2e956e3ef32376911162b5ad436d825e4bf244afeb94567107e0d0e45344
6
+ metadata.gz: d092540fe47c5d2cd8b6712a516acbd8904e9ccedb18670baf427243fde25e1663a035b5bada89e05c333d2208cda883e05dd6fb15e830c6fd7eef500d050cf6
7
+ data.tar.gz: 3cad92de7d0d29637ecbf485bc0c09ccc2f075622b78af197361e7328fe9dd2666fda2060c19a600b437a78bcf561d43654fdaeb4da28ed47db6faeb35231357
data/README.md CHANGED
@@ -33,4 +33,4 @@ Then just use the HTML pipeline normally.
33
33
 
34
34
  Because of the Liquid template engine, if you use this filter with Jekyll, you might find that your curly brace tags--such as `{{#tip}}`--disappear.
35
35
 
36
- You'll need to pass the context `amf_use_blocks` through your filter. This sets up a totally safe monkey-patch to convert the `{{ }}` blocks into `[[ ]]`, so that Liquid ignores them. Then, this renderer will convert the Markdown appropriately.
36
+ You'll need to pass the context `emf_use_blocks` through your filter. This sets up a totally safe monkey-patch to convert the `{{ }}` blocks into `[[ ]]`, so that Liquid ignores them. Then, this renderer will convert the Markdown appropriately.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "extended-markdown-filter"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.3.1"
4
4
  spec.authors = ["Garen Torikian"]
5
5
  spec.email = ["gjtorikian@gmail.com"]
6
6
  spec.summary = %q{Add extended markup syntax to the HTML::Pipeline}
@@ -13,14 +13,14 @@ class ExtendedMarkdownFilter < HTML::Pipeline::MarkdownFilter
13
13
  include Filters::PreFilter
14
14
  include Filters::PostFilter
15
15
 
16
- AMF_CURLY_TAGS = %w(intro mac windows linux all tip warning error).join('|')
16
+ EMF_CURLY_TAGS = %w(intro mac windows linux all tip warning error).join('|')
17
17
 
18
18
  def initialize(text, context = nil, result = nil)
19
- if defined?(Jekyll) && context[:amf_use_blocks]
19
+ if defined?(Jekyll) && context[:emf_use_blocks]
20
20
  require 'jekyll-override'
21
21
  end
22
22
 
23
- if context[:amf_use_blocks]
23
+ if context[:emf_use_blocks]
24
24
  text = self.class.convert_curly_to_bracket(text)
25
25
  end
26
26
 
@@ -34,8 +34,8 @@ class ExtendedMarkdownFilter < HTML::Pipeline::MarkdownFilter
34
34
  end
35
35
 
36
36
  def self.convert_curly_to_bracket(text)
37
- text = text.gsub(/\{\{\s*#(#{AMF_CURLY_TAGS})\s*\}\}/, '[[#\1]]')
38
- text = text.gsub(/\{\{\s*\/(#{AMF_CURLY_TAGS})\s*\}\}/, '[[/\1]]')
37
+ text = text.gsub(/\{\{\s*#(#{EMF_CURLY_TAGS})\s*\}\}/, '[[#\1]]')
38
+ text = text.gsub(/\{\{\s*\/(#{EMF_CURLY_TAGS})\s*\}\}/, '[[/\1]]')
39
39
  text = text.gsub(/\{\{\s*(octicon-\S+\s*[^\}]+)\s*\}\}/, '[[\1]]')
40
40
 
41
41
  text
@@ -11,17 +11,17 @@ module Filters
11
11
  module_function :context=
12
12
 
13
13
  def front_wrap
14
- (context[:amf_use_blocks] == true) ? "\\[\\[" : "\{\{"
14
+ (context[:emf_use_blocks] == true) ? "\\[\\[" : "\{\{"
15
15
  end
16
16
  module_function :front_wrap
17
17
 
18
18
  def end_wrap
19
- (context[:amf_use_blocks] == true) ? "\\]\\]" : "\}\}"
19
+ (context[:emf_use_blocks] == true) ? "\\]\\]" : "\}\}"
20
20
  end
21
21
  module_function :end_wrap
22
22
 
23
23
  def wrap_symbol
24
- (context[:amf_use_blocks] == true) ? "\\]" : "}"
24
+ (context[:emf_use_blocks] == true) ? "\\]" : "}"
25
25
  end
26
26
  module_function :wrap_symbol
27
27
  end
@@ -35,7 +35,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
35
35
  end
36
36
 
37
37
  def test_block_intro
38
- doc = ExtendedMarkdownFilter.to_document(fixture("block_intro.md"), {:amf_use_blocks => true})
38
+ doc = ExtendedMarkdownFilter.to_document(fixture("block_intro.md"), {:emf_use_blocks => true})
39
39
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
40
40
 
41
41
  assert_equal 1, doc.css('div.intro').size
@@ -43,7 +43,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
43
43
  end
44
44
 
45
45
  def test_intro_conversion
46
- doc = ExtendedMarkdownFilter.to_document(fixture("intro.md"), {:amf_use_blocks => true})
46
+ doc = ExtendedMarkdownFilter.to_document(fixture("intro.md"), {:emf_use_blocks => true})
47
47
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
48
48
 
49
49
  assert_equal 1, doc.css('div.intro').size
@@ -65,7 +65,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
65
65
  end
66
66
 
67
67
  def test_block_os_blocks
68
- doc = ExtendedMarkdownFilter.to_document(fixture("block_os_blocks.md"), {:amf_use_blocks => true})
68
+ doc = ExtendedMarkdownFilter.to_document(fixture("block_os_blocks.md"), {:emf_use_blocks => true})
69
69
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
70
70
 
71
71
  assert_equal 1, doc.css('div.platform-mac').size
@@ -79,7 +79,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
79
79
  end
80
80
 
81
81
  def test_block_conversion
82
- doc = ExtendedMarkdownFilter.to_document(fixture("os_blocks.md"), {:amf_use_blocks => true})
82
+ doc = ExtendedMarkdownFilter.to_document(fixture("os_blocks.md"), {:emf_use_blocks => true})
83
83
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
84
84
 
85
85
  assert_equal 1, doc.css('div.platform-mac').size
@@ -105,7 +105,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
105
105
  end
106
106
 
107
107
  def test_block_admonition
108
- doc = ExtendedMarkdownFilter.to_document(fixture("block_admonition.md"), {:amf_use_blocks => true})
108
+ doc = ExtendedMarkdownFilter.to_document(fixture("block_admonition.md"), {:emf_use_blocks => true})
109
109
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
110
110
 
111
111
  assert_equal 1, doc.css('div.tip').size
@@ -117,7 +117,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
117
117
  end
118
118
 
119
119
  def test_admonition_conversion
120
- doc = ExtendedMarkdownFilter.to_document(fixture("admonition.md"), {:amf_use_blocks => true})
120
+ doc = ExtendedMarkdownFilter.to_document(fixture("admonition.md"), {:emf_use_blocks => true})
121
121
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
122
122
 
123
123
  assert_equal 1, doc.css('div.tip').size
@@ -138,7 +138,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
138
138
  end
139
139
 
140
140
  def test_block_octicon
141
- doc = ExtendedMarkdownFilter.to_document(fixture("block_octicon.md"), {:amf_use_blocks => true})
141
+ doc = ExtendedMarkdownFilter.to_document(fixture("block_octicon.md"), {:emf_use_blocks => true})
142
142
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
143
143
 
144
144
  assert_equal 1, doc.css('span.cat').size
@@ -147,7 +147,7 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
147
147
  end
148
148
 
149
149
  def test_oction_conversion
150
- doc = ExtendedMarkdownFilter.to_document(fixture("octicon.md"), {:amf_use_blocks => true})
150
+ doc = ExtendedMarkdownFilter.to_document(fixture("octicon.md"), {:emf_use_blocks => true})
151
151
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
152
152
 
153
153
  assert_equal 1, doc.css('span.cat').size
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extended-markdown-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian