literate_md 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/literate_md +3 -2
  2. metadata +3 -3
data/bin/literate_md CHANGED
@@ -60,7 +60,7 @@ if opts.weave
60
60
  code = File.open(file, 'r'){|f|f.read}
61
61
  r.renderer.original_text = code
62
62
  html = r.render(code)
63
- write_to("#{opts.outputdir}/#{file}.html", html)
63
+ write_to("#{opts.outputdir}/#{File.basename(file)}.html", html)
64
64
  }
65
65
  end
66
66
 
@@ -75,7 +75,8 @@ class Tangle < Redcarpet::Render::Base
75
75
  [{:start => code.length}]
76
76
  (1..chunks.length-1).each{|index|
77
77
  last, this = chunks[index-1], chunks[index]
78
- @links[normalise(last[:anchor],lang)] << code[last[:start] + last[:anchor_len], this[:start]]
78
+ new_snippet = code[last[:start] + last[:anchor_len], this[:start]]
79
+ @links[normalise(last[:anchor],lang)] << new_snippet if not new_snippet.strip.empty?
79
80
  }
80
81
  nil
81
82
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: literate_md
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - remis