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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deb6571b078af6e55248f6e7a882e27972c51a82
4
- data.tar.gz: 89a90cb970842b5b387224a83dd8ac96d18eb605
3
+ metadata.gz: 4ba23c23006d361a3ac96773bce7d991f3f88650
4
+ data.tar.gz: 2aec7cc849fb5186259a1eaadc8f0e57d28a6ee0
5
5
  SHA512:
6
- metadata.gz: ea2929a0724d45142390c82f29115e06e0ae41de93bba1735be17202415152a7f1d48be90b0899dbdfda9fbb844e6935a6d5d02db2cffffee08ad77ae0a27946
7
- data.tar.gz: c19a40b904815f71a0eaf04e67436f9ff178f8eec960de95737318f2af59dacc49d1b66c05d71e246786b2890cdf69a89a77406c948e7f8f45a37ca3b8c34436
6
+ metadata.gz: 9dfa23a5c9ae95fb088d4ef0f59d7227875c92fa5b28411fa2c7fa05ce9500971e680f500c9b9b7d50c86fc75f6f4d42d8929d194a200496763e96ea7afd5099
7
+ data.tar.gz: 1814b9ef6726259e240cdd0c8757c928fa9515d245ecac74559bfd1bf819e4fbe94842c2099b2bddff56e5b7fdab3c898d8b7b58c5b4c079a551fed029aa7f13
@@ -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
- file = Tempfile.new(["code", ".#{code.extension}"])
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
 
@@ -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
- slide.code = Code.new(child.text, child.attribute('class').value)
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
@@ -1,3 +1,3 @@
1
1
  module Md2key
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
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.3
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-10 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor