improve_typography 0.1.8 → 0.1.9

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: 721d87876434dafa87adc6edbbde6356b4d1326c
4
- data.tar.gz: f2a0a064bca24e78d306bf8f8d37e9f0e3344435
3
+ metadata.gz: 15de4945fe7e742d77f6bab3f6899c8311ea9b28
4
+ data.tar.gz: da8c36060a8b50d0771f123668baa62b4f12b3c6
5
5
  SHA512:
6
- metadata.gz: 6710a481f3ba73aef987909377677d0cf1dde23b98e7b5a1fd01bc213d44e21d183d30a1ff51d21ea91295ccaafd51ca7c1ac3fd76a4c6d590298444cbf22e5f
7
- data.tar.gz: 2e5fc13fd514b92036cb662f1b9c5478ac3ded94a484cfd3697f594be3c14771db061ad6137a803969f483499b3d8974a61e82ade675008be5e598b2570ee619
6
+ metadata.gz: cf287039ae45d750ce6995d0b4ddd6cf6d04402d26dbabd2500e71c059ad6c59300ad21812d1c563fe88eeac9f2869a77f1f72280e1b5d54a86fcae012223392
7
+ data.tar.gz: 4c9e35546556bfb94514115542bba1e800b60452452eb242751c0991df158d6ae96be6d2e9da054f209a3dadd934f2968e26d8735b120ae4cbd21ed4c0960e15
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.9
4
+
5
+ * Improve `Nbsp` processor (avoid matching newlines etc.)
6
+
3
7
  ## 0.1.8
4
8
 
5
9
  * Add `Nbsp` processor to default processors
@@ -3,9 +3,9 @@ module ImproveTypography
3
3
  class Nbsp < Processor
4
4
  def call
5
5
  str
6
- .gsub(/(\s+)(.|\d+|.\.)(\s+)(.)/, '\1\2&nbsp;\4') # in the middle of string
7
- .gsub(/\A(.|\d+|.\.)(\s+)(.)/, '\1&nbsp;\3') # at the beginning of string
8
- .gsub(/(\s+)(.|\d+|.\.)(\z|[\.?!]\z|[\.?!]\s)/, '&nbsp;\2\3') # at the end of string
6
+ .gsub(/(\s+)(\S|\d+|\S\.)(\s+)(\S)/, '\1\2&nbsp;\4') # in the middle of string
7
+ .gsub(/\A(\w|\d+|\w\.)(\s+)(\S)/, '\1&nbsp;\3') # at the beginning of string
8
+ .gsub(/([^\S\n])(\S|\d+|\S\.)(\z|[\.?!]\z|[\.?!]\s)/, '&nbsp;\2\3') # at the end of string!!
9
9
  .gsub(/(\A|\s+)(©)(\s+)(\d+)/, '\1\2&nbsp;\3')
10
10
  .gsub(/(\A|\s+)(No\.|Vol\.)(\s+)(\d+)/, '\1\2&nbsp;\3')
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module ImproveTypography
2
- VERSION = '0.1.8'.freeze
2
+ VERSION = '0.1.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: improve_typography
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n