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.
- data/lib/kramdown-gist/version.rb +1 -1
- data/lib/kramdown-gist.rb +4 -4
- data/spec/kramdown-gist_spec.rb +2 -2
- metadata +2 -2
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,
|
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.
|
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.
|
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.
|
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
|
data/spec/kramdown-gist_spec.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2012-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: kramdown
|