Show only leading and trailing whitespace

Can an option be added to show only leading and trailing whitespace and not for any whitespace in the middle of text?