Options: removeSpaceDups

The removeSpaceDups option determines how will duplicated space be handled by generativeText.

This option is not taken into consideration when using .applyToElementsSequentially().

removeSpaceDups=true (default)

If you do not specify any removeSpaceDups option, the default: true is used. All duplicated space is removed.

removeSpaceDups=false

Duplicated space is kept.

Example

Space: a continuous area or expanse which is free , available , or unoccupied.

var rules = {
    color: {
        values: ["#111111", "#eeeeee"],
        steps: true,
    },
    backgroundColor: {
        values: ["#003B46", "#07575B", "#66A5AD"],
        steps: true,
    }

}

var opts = {
    removeSpaceDups: false,
}

var keepSpaces = new generativeText(rules, opts);
keepSpaces.applyToElementById("example1");
            

#example1 span { width: 0.62em; text-align: right; border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
            

<div id="example1">Space:    a continuous area or expanse which is free   , available , or             unoccupied.</div>