sunflower 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +1 -1
  2. data/lib/sunflower/core.rb +6 -1
  3. metadata +2 -2
data/README CHANGED
@@ -1,4 +1,4 @@
1
- Version: 0.5.10 alpha
1
+ Version: 0.5.11 alpha
2
2
 
3
3
  >>> English:
4
4
 
@@ -40,7 +40,7 @@ end
40
40
  #
41
41
  # You can use multiple Sunflowers at once, to work on multiple wikis.
42
42
  class Sunflower
43
- VERSION = '0.5.10'
43
+ VERSION = '0.5.11'
44
44
 
45
45
  INVALID_CHARS = %w(# < > [ ] | { })
46
46
  INVALID_CHARS_REGEX = Regexp.union *INVALID_CHARS
@@ -349,6 +349,11 @@ class Sunflower
349
349
 
350
350
  # Cleans up underscores, percent-encoding and title-casing in title (with optional anchor).
351
351
  def cleanup_title title, preserve_case=false, preserve_colon=false
352
+ # strip unicode bidi junk
353
+ title = title.gsub /[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/, ''
354
+ # strip unicode spaces
355
+ title = title.gsub /[\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+/, ' '
356
+
352
357
  return '' if title.strip == ''
353
358
 
354
359
  name, anchor = title.split '#', 2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunflower
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-24 00:00:00.000000000 Z
12
+ date: 2013-05-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json