markdown_helper 2.5.3 → 2.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/markdown_helper/markdown_includer.rb +5 -6
- data/lib/markdown_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9cb40e6c28ad8ab00fa7caed20424516b043f2ffa4fc470266718797023c9ba
|
4
|
+
data.tar.gz: 5c91ca661941e841d4a89f8eed39487ced7d87a4805319f272bb8b34668ed675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d3c3d58bb8de71d1488e582d53c24aaef9b247cd2374c0ecff8cc82cd09d19a5c2233b775752920d4ff10f24c6b503991e5dd80d687cc85d50b9a0cb6c83135
|
7
|
+
data.tar.gz: a22eceef5d1427e8169df501a797dd96916d7b1c242f0813b38910d9874182bcb727d6305d063bf351154484cde0dd57c13af89ea58333e02df6598b7e3e2a0e
|
data/Gemfile.lock
CHANGED
@@ -233,15 +233,14 @@ class MarkdownIncluder < MarkdownHelper
|
|
233
233
|
|
234
234
|
|
235
235
|
def link(anchor_counts = Hash.new(0))
|
236
|
-
|
237
|
-
|
238
|
-
anchor
|
239
|
-
|
240
|
-
gsub(to_hyphen_regexp, '-').
|
241
|
-
downcase
|
236
|
+
anchor = title.downcase
|
237
|
+
anchor.gsub!(/[^\p{Word}\- ]/u, '') # remove punctuation
|
238
|
+
anchor.gsub!(' ', '-') # replace spaces with dash
|
239
|
+
|
242
240
|
anchor_count = anchor_counts[anchor]
|
243
241
|
anchor_counts[anchor] += 1
|
244
242
|
suffix = (anchor_count == 0) ? '' : "-#{anchor_count}"
|
243
|
+
|
245
244
|
"[#{title}](##{anchor}#{suffix})"
|
246
245
|
end
|
247
246
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdown_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- burdettelamar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|