Strip trailing whitespace from markdown, rst