md2key 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/md2key/highlight.rb +4 -1
- data/lib/md2key/markdown.rb +2 -1
- data/lib/md2key/version.rb +1 -1
- 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: 4ba23c23006d361a3ac96773bce7d991f3f88650
|
4
|
+
data.tar.gz: 2aec7cc849fb5186259a1eaadc8f0e57d28a6ee0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dfa23a5c9ae95fb088d4ef0f59d7227875c92fa5b28411fa2c7fa05ce9500971e680f500c9b9b7d50c86fc75f6f4d42d8929d194a200496763e96ea7afd5099
|
7
|
+
data.tar.gz: 1814b9ef6726259e240cdd0c8757c928fa9515d245ecac74559bfd1bf819e4fbe94842c2099b2bddff56e5b7fdab3c898d8b7b58c5b4c079a551fed029aa7f13
|
data/lib/md2key/highlight.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
module Md2key
|
2
2
|
class Highlight
|
3
|
+
DEFAULT_EXTENSION = "txt"
|
3
4
|
class << self
|
4
5
|
def pbcopy_highlighted_code(code)
|
5
6
|
ensure_highlight_availability
|
6
7
|
|
7
|
-
|
8
|
+
extension = code.extension || DEFAULT_EXTENSION
|
9
|
+
|
10
|
+
file = Tempfile.new(["code", ".#{extension}"])
|
8
11
|
file.write(code.source)
|
9
12
|
file.close
|
10
13
|
|
data/lib/md2key/markdown.rb
CHANGED
@@ -59,7 +59,8 @@ module Md2key
|
|
59
59
|
when 'pre'
|
60
60
|
node.children.each do |child|
|
61
61
|
next if !child.is_a?(Oga::XML::Element) || child.name != 'code'
|
62
|
-
|
62
|
+
extension = child.attribute('class') ? child.attribute('class').value : nil
|
63
|
+
slide.code = Code.new(child.text, extension)
|
63
64
|
end
|
64
65
|
when 'hr'
|
65
66
|
# noop
|
data/lib/md2key/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: md2key
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|