Opened 12 years ago
Closed 12 years ago
#11783 closed Bug (fixed)
Link in image caption is taken as link which wraps image
| Reported by: | Piotrek Koszuliński | Owned by: | Olek Nowodziński |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.4.0 |
| Component: | General | Version: | 4.4.0 |
| Keywords: | Drupal | Cc: | wim.leers@… |
Description
In image2 sample load:
<figure class="image"><img alt="Saturn V" src="assets/image1.jpg" width="200" /> <figcaption>Roll out <a href="x">of Saturn V</a> on launch pad</figcaption> </figure>
Kaboom! The issue is caused by widget.parts.link discovering the link inside figcaption.
Change History (5)
comment:1 Changed 12 years ago by
| Status: | new → confirmed |
|---|
comment:2 Changed 12 years ago by
| Cc: | wim.leers@… added |
|---|---|
| Keywords: | Drupal added |
comment:3 follow-up: 4 Changed 12 years ago by
| Owner: | set to Olek Nowodziński |
|---|---|
| Status: | confirmed → review |
It could be solved with the following selector if IE8 supported :not():
link: 'a[data-widget],*:not(figcaption)>a'
But it does not. Fix pushed to branch:t/11783 (tests).
comment:4 Changed 12 years ago by
Replying to a.nowodzinski:
It could be solved with the following selector if IE8 supported
:not():link: 'a[data-widget],*:not(figcaption)>a'But it does not. Fix pushed to branch:t/11783 (+tests).
comment:5 Changed 12 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review → closed |
Thanks. R+, merged to major with git:e20ae7b on dev and 2a75dd9 on tests.

I found and reported this.
And I think I've found the solution.
In the
image2plugin's widget definition:parts: { image: 'img', caption: 'figcaption', link: 'a' },The
widgetplugin'ssetupParts()function callsThis selects any
aelement inside the widget. Which causes the wrongato be selected: the one in the caption.So the solution is super simple: just update the selector!
parts: { image: 'img', caption: 'figcaption', link: 'figure>a' },