fixes TrimDirectiveWhitespaces for first/last text