Do not strip leading and trailing whitespace from raw posts (PR #172)

This is in response to the thread Stripping Leading Whitespace Breaks Code Blocks at Beginning of Post on meta.discourse.

Code blocks at the beginning of a post are broken because leading whitespace is stripped from posts’ raw bodies. This patch removes the whitespace-stripping behaviour, but adds a new validator so that length limits are still enforced on posts as though the whitespace was stripped.

GitHub

also, looks like the PR can no longer be merged, can you update it ?

also, big thank you :slight_smile:

we probably want this to be localizable, can you pass it through i18n ?

Sure, I’ll use the same localizable messages as Rails’ standard LengthValidator.

Should I submit a new pull request of a fresh branch, or add another commit to this one?

Its fine to add the commit to this one, makes more sense

On Mon, Feb 18, 2013 at 12:32 PM, Jeremy Banks notifications@github.comwrote:

we probably want this to be localizable, can you pass it through i18n ?

Sure, I’ll use the same localizable messages as Rails’ standard LengthValidator.

Should I submit a new pull request of a fresh branch, or add another commit to this one?

— Reply to this email directly or view it on GitHubhttps://github.com/discourse/discourse/pull/172#issuecomment-13703038.

This looks great, thanks :fish: