kramdown-gist 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,6 @@
20
20
  module Kramdown
21
21
  module Parser
22
22
  # Version of {Kramdown::Parser::KramdownGist}
23
- KRAMDOWN_GIST_VERSION = "0.0.1"
23
+ KRAMDOWN_GIST_VERSION = "0.0.2"
24
24
  end
25
25
  end
data/lib/kramdown-gist.rb CHANGED
@@ -56,7 +56,7 @@ module Kramdown
56
56
  def parse_gist
57
57
  @src.pos += @src.matched_size
58
58
  gist_id = @src[1]
59
- @tree.children << Element.new(:gist, nil, {'gist-id' => gist_id})
59
+ @tree.children << Element.new(:gist, gist_id)
60
60
  end
61
61
  define_parser(:gist, GIST_START)
62
62
 
@@ -72,7 +72,7 @@ module Kramdown
72
72
  # @return [String] an HTML fragment representing this element
73
73
  # @api private
74
74
  def convert_gist(el, indent)
75
- "#{' '*indent}<script src=\"http://gist.github.com/#{el.attr['gist-id']}.js\"></script>\n"
75
+ "#{' '*indent}<script src=\"http://gist.github.com/#{el.value}.js\"></script>\n"
76
76
  end
77
77
 
78
78
  end
@@ -84,7 +84,7 @@ module Kramdown
84
84
  # @return [String] an Kramdown fragment representing this element
85
85
  # @api private
86
86
  def convert_gist(el, opts)
87
- "*{gist:#{el.attr['gist-id']}}\n"
87
+ "*{gist:#{el.value}}\n"
88
88
  end
89
89
  end
90
90
 
@@ -97,7 +97,7 @@ module Kramdown
97
97
  # @return [String] a LaTeX fragment representing this element
98
98
  # @api private
99
99
  def convert_gist(el, opts)
100
- gist_id = el.attr['gist-id']
100
+ gist_id = el.value
101
101
  "See \\href{https://gist.github.com/#{gist_id}}{Gist #{gist_id}}.\n\n"
102
102
  end
103
103
  end
@@ -37,10 +37,10 @@ describe Kramdown::Parser::KramdownGist do
37
37
  end
38
38
 
39
39
  it "is idempotent when generating kramdown" do
40
- ::Kramdown::Document.new("*{gist:1234}", :input => 'KramdownGist').to_kramdown eql("*{gist:1234}\n")
40
+ ::Kramdown::Document.new("*{gist:1234}", :input => 'KramdownGist').to_kramdown.should eql("*{gist:1234}\n\n")
41
41
  end
42
42
 
43
43
  it "renders to a suitable placeholder when generating LaTeX" do
44
- ::Kramdown::Document.new("*{gist:1234}", :input => 'KramdownGist').to_latex eql("See \\href{https://gist.github.com/1234}{Gist 1234}.\n\n")
44
+ ::Kramdown::Document.new("*{gist:1234}", :input => 'KramdownGist').to_latex.should eql("See \\href{https://gist.github.com/1234}{Gist 1234}.\n\n")
45
45
  end
46
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-gist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-15 00:00:00.000000000 Z
12
+ date: 2012-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: kramdown