literate_md 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/literate_md +4 -2
  2. metadata +3 -3
data/bin/literate_md CHANGED
@@ -72,10 +72,12 @@ class Tangle < Redcarpet::Render::Base
72
72
  code.scan(/(@(#{$allowed})@\s*\+=)/).map{|x|
73
73
  {:start => code.index(x[0]), :anchor => x[1], :anchor_len => x[0].length}
74
74
  } +
75
- [{:start => code.length}]
75
+ [{:start => code.length, :anchor_len => 0}]
76
76
  (1..chunks.length-1).each{|index|
77
77
  last, this = chunks[index-1], chunks[index]
78
- new_snippet = code[last[:start] + last[:anchor_len], this[:start]]
78
+ new_snippet = code[
79
+ last[:start] + last[:anchor_len],
80
+ [this[:start] - this[:anchor_len], 0 ].max ]
79
81
  @links[normalise(last[:anchor],lang)] << new_snippet if not new_snippet.strip.empty?
80
82
  }
81
83
  nil
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - remis