Opened 12 years ago
Closed 12 years ago
#11133 closed Bug (fixed)
Pagebreak loses contenteditable=false when pasting
| Reported by: | Piotrek Koszuliński | Owned by: | Olek Nowodziński |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.3.2 |
| Component: | General | Version: | 4.1 RC |
| Keywords: | Cc: |
Description
It's lost, because it's not part of pagebreak's ACF rules. It could be added by dataFilter rule, but the style checks do not pass on internal form of pagebreak (no display:none style).
BTW. Regexp patterns are compiled every time div is filtered - they should be cached.
Change History (10)
comment:1 Changed 12 years ago by
| Status: | new → confirmed |
|---|
comment:2 Changed 12 years ago by
| Milestone: | CKEditor 4.3.1 → CKEditor 4.3.2 |
|---|
comment:3 Changed 12 years ago by
| Owner: | set to Olek Nowodziński |
|---|---|
| Status: | confirmed → assigned |
comment:4 Changed 12 years ago by
| Status: | assigned → review |
|---|
comment:5 follow-up: 6 Changed 12 years ago by
| Status: | review → review_failed |
|---|
There's no such thing as element.classes. It's a leftover from ACF. Use element.hasClass.
And yes - pagebreak should be a widget.
comment:6 Changed 12 years ago by
| Status: | review_failed → review |
|---|
Replying to Reinmar:
There's no such thing as
element.classes. It's a leftover from ACF. Useelement.hasClass.
That's true, element.hasClass is the proper one. But it was more than that: since I checked element#classes for cke_pagebreak which was stripped out by ACF, the condition was also logically invalid. The correct check is
if ( element.attributes[ 'data-cke-display-name' ] )
...
comment:7 Changed 12 years ago by
| Status: | review → review_failed |
|---|
Hm... this checks something totally different. This attribute carries information for elements path and can be used by various features. So this condition will give false positives.
comment:8 Changed 12 years ago by
| Status: | review_failed → review |
|---|
It turned out that data-cke-pagebreak survives filtering and it's enough to tell pagebreak from other elements.
I also unified the way of setting the attributes of the "internal form" because I found it quite inconsistent and misleading. At the moment both pagebreak command and dataFilter rule use the same set of attributes generated by attributesSet which finally makes them totally coherent.
comment:9 Changed 12 years ago by
| Status: | review → review_passed |
|---|
I pushed two commits to dev and tests. Solution is clean so it's good. Internal form is marked with a data-cke-pagebreak attribute and all data-cke-* attrs are allowed by ACF on input and are stripped by default data processor on output.
comment:10 Changed 12 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
git:77ab1b8 (dev) and 00a8345 (tests) landed in master.

Solution in t/11133 (+ corresponding test branch).
Still I'm not quite convinced whether such a weak condition is enough to distinguish pagebreaks from regular divs while pasting.
TODO: Pagebreak should definitely be a widget.