Repository navigation
Commit f1f3106
committed
Media: Ensure figcaption/figure IDs are unique.
Using the same image multiple times with a `figure` and `fig caption` would result in duplicate IDs, creating unclear relationships and breaking 3rd party expectations for anchor targets. Check id attributes and append a counter to ensure each attribute is unique, while retaining the current expectation of a counter-less ID attribute for the first instance. Update tests to verify.
Developed in WordPress/wordpress-develop#11940
Props steelwagstaff, westonruter, jamesbregenzer, joedolson, mukesh27.
Fixes #65315.
Built from https://develop.svn.wordpress.org/trunk@62698
git-svn-id: http://core.svn.wordpress.org/trunk@61982 1a063a9b-81f0-0310-95a4-ce76da25c4cd1 parent 7ac9bfb commit f1f3106
2 files changed
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2656 | 2656 | | |
2657 | 2657 | | |
2658 | 2658 | | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
2659 | 2669 | | |
2660 | 2670 | | |
2661 | 2671 | | |
| |||
2675 | 2685 | | |
2676 | 2686 | | |
2677 | 2687 | | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
2681 | 2693 | | |
2682 | 2694 | | |
2683 | | - | |
2684 | | - | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
2685 | 2698 | | |
2686 | 2699 | | |
2687 | 2700 | | |
| 2701 | + | |
2688 | 2702 | | |
2689 | | - | |
2690 | | - | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
2691 | 2707 | | |
2692 | 2708 | | |
2693 | | - | |
2694 | | - | |
2695 | | - | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
2696 | 2712 | | |
2697 | 2713 | | |
2698 | 2714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments