Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added endorsements to the README

  • Loading branch information...
commit f9c0c4fc2af8095cf52d48dbaad08ae939476957 1 parent b1ad50c
@aristus authored
Showing with 18 additions and 3 deletions.
  1. +16 −1 README
  2. +2 −2 sweet-justice.js
View
17 README
@@ -15,6 +15,21 @@ hyphen characters (0x00AD) into long words.
Requires either jQuery or YUI3.
+WHAT PEOPLE ARE SAYING:
+----------------------------------------------
+
+"This is just terrible."
+ -- globally_unique_id
+
+"A nice idea, but unusable."
+ -- eleven3
+
+"honestly i'm glad the web doesn't have great
+support for justified text"
+ -- jawbroken
+
+----------------------------------------------
BSD license: Share and enjoy.
@author carlos@bueno.org 23 April 2010
-github.com/aristus/sweet-justice
+github.com/aristus/sweet-justice
+
View
4 sweet-justice.js
@@ -70,7 +70,7 @@
words[i] = words[i]
.replace(vccv, '$1\u00AD$2')
.replace(simple, '$1\u00AD$2')
- .replace(/\u00AD(.?)$/, '$1'); // no "hyphen-s"
+ .replace(/\u00AD(.?)|$\u00AD(.{0,2}\w+)$/, '$1'); // no "hyphen-s"
}
}
return words.join(' ');
@@ -87,7 +87,7 @@
var c = '[^'+vowels+']';
var v = '['+vowels+']';
var vccv = new RegExp('('+v+c+')('+c+v+')', 'g');
- var simple = new RegExp('(.{2,3}'+v+')'+'('+c+')', 'g');
+ var simple = new RegExp('(.{2,4}'+v+')'+'('+c+')', 'g');
// determine whether a word is good for hyphenation.
// no numbers, email addresses, hyphens, or &entities;
Please sign in to comment.
Something went wrong with that request. Please try again.