q2a-markdown-editor icon indicating copy to clipboard operation
q2a-markdown-editor copied to clipboard

Minimum length of question body does not work correctly for Markdown editor

Open fardina opened this issue 5 years ago • 3 comments

It seems markdown does not count html tags.

Example to reproduce the issue: set Minimum length of question body to 100 character for example. question body text: <p>94 characters here...</p> So the question body is 101 characters. But It gets the error for min length of question body.

fardina avatar May 26 '20 10:05 fardina

@svivian Do you have any idea why this happen?

fardina avatar May 28 '20 18:05 fardina

@svivian there is also another problem in this regard.

for example my site is about mathematics when a question started by

Let x<y ...

then all the text after < is not counted and users get the error of minimum length of question body.

this happens alot in my site.

could you Please kindly make a comment?

fardina avatar Aug 02 '20 09:08 fardina

This can be solved by changing 'html' to '' on line 39 in qa-markdown-viewer.php

However, you now get the opposite problem, where someone can enter

<p><span><span>123</span></span></p>

So they only put 3 characters (that are actually displayed) but it counts it as over 30 characters (the minimum I was using for testing). Probably, making the change makes it easier for most users.

svivian avatar Aug 03 '20 17:08 svivian