What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

First reported here by haylem.

Steps to reproduce:

  1. Construct a post consisting of exactly 30,000 non-markup characters (no HTML or Markdown formatting). Here's one for you: Formatting Sandbox

  2. Edit it to add some more non-markup text. For instance, a period at the end.

  3. Try to submit the edit. Note the error:

    body is limited to 30000 characters; you entered 30001

  4. Reverting your previous edit, make a new one consisting only of markup. Bold a word, or add a link:

    wrapping the last word in double apostrophes to bold it

  5. Submit this edit, and note that while the text submitted is now even longer than in #3, the edit is accepted. But the post is truncated at 30000 characters:

    the last four characters chopped off

This is really the worst of both worlds: the editor isn't forced to limit his text, but the text itself is cut or mangled to some degree (chopping off the link table found at the end of long, well-referenced posts is particularly cruel).

I suspect this behavior was introduced with the recent change to validate minimum length after first stripping markup. That behavior is good - it ensures the spirit of the minimum length check is preserved by disallowing markup tricks and excessive linking to subvert it.

Recommended solution

For ease of use, the maximum length check should be done prior to stripping HTML, thus preserving the (relatively) friendly warnings instead of the (extremely) unfriendly truncation.

Alternately, the truncation behavior could be removed entirely, allowing 30000 displayed characters and however much markup is desired.

share|improve this question

1 Answer 1

up vote 13 down vote accepted

I suspect this behavior was introduced with the recent change to validate minimum length after first stripping markup.

That's correct, the maximum length check was accidentally changed to be based on the converted and stripped version as well.

Since the maximum length is still enforced on the Markdown source, but the validation happened on the converted/stripped version (which has a good chance of being shorter), the truncation took place.

Fixed in the next build.

share|improve this answer
    
Awesome. Thanks (and thanks to @Shog9). –  haylem Jul 11 '12 at 11:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .