markdown_helper 2.5.3 → 2.5.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d2db5445cf4ffb89620cb25b2398039a51e220998daf5faee18460f28cba80b
4
- data.tar.gz: f29c591a7476c98a129848adfb8ee8c5d6279bf562353632d37a43386da99f77
3
+ metadata.gz: d9cb40e6c28ad8ab00fa7caed20424516b043f2ffa4fc470266718797023c9ba
4
+ data.tar.gz: 5c91ca661941e841d4a89f8eed39487ced7d87a4805319f272bb8b34668ed675
5
5
  SHA512:
6
- metadata.gz: 53b52f9a2024ead671a40bf521ba8a6be0b436477bcbbb599c588e45c29932cca9dacea2a9d232ad2c111240999913aa5eb04828d95b71465ac9138b8e67eab9
7
- data.tar.gz: ca38ee5472ed9b6425bd8ccd87c49a45623b6de0dcb1661bfffeb2ef14dd4e41c6b22349bcee4432af66d961e0695fef8217b3d49fffe3ff43db2b8247eaa5b1
6
+ metadata.gz: 8d3c3d58bb8de71d1488e582d53c24aaef9b247cd2374c0ecff8cc82cd09d19a5c2233b775752920d4ff10f24c6b503991e5dd80d687cc85d50b9a0cb6c83135
7
+ data.tar.gz: a22eceef5d1427e8169df501a797dd96916d7b1c242f0813b38910d9874182bcb727d6305d063bf351154484cde0dd57c13af89ea58333e02df6598b7e3e2a0e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_helper (2.5.3)
4
+ markdown_helper (2.5.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -233,15 +233,14 @@ class MarkdownIncluder < MarkdownHelper
233
233
 
234
234
 
235
235
  def link(anchor_counts = Hash.new(0))
236
- remove_regexp = /[\=\#\(\)\[\]\{\}\.\?\+\*\`\"\']+/
237
- to_hyphen_regexp = /\W+/
238
- anchor = title.
239
- gsub(remove_regexp, '').
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
@@ -1,3 +1,3 @@
1
1
  class MarkdownHelper
2
- VERSION = '2.5.3'
2
+ VERSION = '2.5.4'
3
3
  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.3
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-03 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler