Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining character count is not correct when editing, causing a confusing error message #909

Open
cellio opened this issue Oct 26, 2022 · 0 comments
Labels
area: html/css/js Changes to front-end code area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: bug Something isn't working

Comments

@cellio
Copy link
Member

cellio commented Oct 26, 2022

https://meta.codidact.com/posts/287292

A user edited a post and got the "max post length is 30,000 characters" error message, but according to the character count shown at the bottom of the post edit box, the count was below that limit. An answer there suspects that the length that triggers the error is the rendered HTML, while what the editor's stat is based on is the markdown source.

This is confusing. Are we able to unify these? I don't know the performance considerations, but if the editor is rendering the preview anyway, can we get its HTML's size and show that in the counter? Or, alternatively, can we base the limit on the size of the markdown source, and if we're storing the HTML in the database too, pad that field some to account for HTML bloat?

Related: if we do the check against the rendered HTML, it would also address https://meta.codidact.com/posts/290859 .

@cellio cellio added area: ruby Changes to server-side code area: html/css/js Changes to front-end code type: bug Something isn't working priority: medium complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: html/css/js Changes to front-end code area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant