This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add a soft hypen (­) to any words in the string longer than the given character length | |
* | |
* @param {string} str Input string | |
* @param {int} maxWordSize Max character length of a word | |
* @param {int} minFragmentSize [optional] Minimum chars to leave after a hyphen | |
* @return {string} | |
*/ | |
var hyphenateLongWords = function (str, maxWordSize, minFragmentSize) { | |
// TODO: Find out char codes of word break chars |
NewerOlder