nl_tokens: Adjusts a string to fit within the confines of width without breaking words .
pl_tokens: function wordWrapToLength ( s , width , padleft , padright , omitFirst ) { if ( padright === undefined && padleft ) padright = padleft ; padleft = ! isNaN ( parseInt ( padleft , 10 ) ) ? parseInt ( padleft , 10 ) : 0 ; padright = ! isNaN ( parseInt ( padright , 10 ) ) ? parseInt ( padright , 10 ) : 0 ; var paddingLeft = '' ; for ( var n = 0 ; n < padleft ; n ++ ) paddingLeft += ' ' ; var cols = ! isNaN ( parseInt ( width , 10 ) ) ? length : 120 , arr = s . split ( ' ' ) , item = null , len = ! omitFirst ? cols - padright - padleft : cols - padright , str = ! omitFirst ? paddingLeft : '' , olen = cols - padright - padleft ; while ( ( item = arr . shift ( ) ) !== undefined ) { if ( item . length < len ) { str += item + ' ' ; len -= item . length + 1 ; } else if ( item . length > olen ) { str += item . substring ( 0 , len - 1 ) + '-\n' + paddingLeft ; arr . unshift ( item . substring ( len , item . length - 1 ) ) ; len = cols - padright - padleft ; } else { str += '\n' + paddingLeft + item + ' ' ; len = cols - padright - 1 - padleft - <mask> . length ; } } return str ; }