[MAGNOLIA-4629] Validation pattern in fckEditor is not working as expected Created: 29/Oct/12  Updated: 19/Dec/16

Status: Open
Project: Magnolia
Component/s: fckeditor
Affects Version/s: 4.4.6, 4.5.4
Fix Version/s: 4.5.x

Type: Bug Priority: Neutral
Reporter: Samuel Schmitt Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on a 4.4.6 and 4.5.4. But i guess that the problem is on every 4.4.x and 4.5.x


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

Add a validation pattern like ".

{1,100}

" to a fckEdit control.
You expect that the user can enter 100 chars.

But there are 2 issues:
1. Enter the letter "a", press enter, then enter another letter like "a", the validation message shows up and tell you

The value '<p>a</p>
<p>a</p>' is not valid for the field [Text] on the tab [Text]!

Even with the <p> tags the whole text size is less that 100 chars. The problem comes from the new line.

2. The second issue is maybe more "acceptable".
From a user point of view 100 chars is 100 chars without the "hidden" HTML code added by the RTE.
But a user can enter only 80 chars but the validation will be triggered because there is 25 hidden HTML chars in the text.

It would be great if the validation doesnt care about the HTML.


Generated at Mon Feb 12 03:57:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.