• Lyza Danger Gardner's avatar
    Add utility to trim text-content Ranges · aea38355
    Lyza Danger Gardner authored
    Remove any leading or trailing whitespace and/or nodes from the supplied
    Range. The resulting range starts exactly at the first non-whitespace
    character in the Range and ends exactly at the last non-whitespace
    character in the Range.
    
    `trimRange` assumes the provided Range starts and ends on a text node
    and will throw otherwise.
    aea38355
trim-range-test.js 8.18 KB