PRX / publish.prx.org

Dovetail podcast CMS frontend
https://publish.prx.org
GNU Affero General Public License v3.0
2 stars 2 forks source link

Validate description bytes #776

Closed cavis closed 11 months ago

cavis commented 11 months ago

Validate the HTML-encoded description bytes is < 4000.

The flow goes like this:

  1. User enters a description markdown of something like 3000 chars. Frontend validations are fine with that.
  2. User clicks save - CMS saves the markdown plus the HTML encoded version to the database.
  3. After save, we decode the description field from the API (the HTML-encoded one)... calculate byte length, and highlight the field in red with the text "Description is too long"
  4. Since this is a strict validation, user is prevented from publishing the episode until they fix the problem.

image