The goal of this kata is to write a small algorithm that splits a given text into chunks with a given maximum length (width);
- Never split between characters, split only at whitespaces
- You are allowed to split a word at a dash, as long as the dash is preserved (in the first line)
- Write an extension to the method that fills spaces with additional whitespaces until the line's length is equal to the allowed width.
- (German) words, that exceed the line length, should be wrapped at the maximum width (e.g. rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz)
NodeJS Template: