| 46 | |
| 47 | ---- |
| 48 | |
| 49 | == Cases == |
| 50 | |
| 51 | === <span> created while joining two adjacent elements === |
| 52 | Related issues: #9998 |
| 53 | |
| 54 | ==== Example 1 ==== |
| 55 | |
| 56 | 1. `<p>foo</p>` |
| 57 | 2. `<p>^bar</p>` |
| 58 | 3. Backspace. |
| 59 | 4. `<p>line1<span style="line-height:1.6">line2</span></p>` |
| 60 | |
| 61 | ==== Example 2 ==== |
| 62 | |
| 63 | 1. `<h1>foo</h1>` |
| 64 | 2. `<p>^bar</p>` |
| 65 | 3. Backspace. |
| 66 | 4. `<h1>foo<span style="font-size:13px; line-height:1.6">bar</span></h1>` |
| 67 | |
| 68 | === Attempt to preserve the visual style of the contents -> i.e. <strong> becomes <b> === |
| 69 | |
| 70 | ==== Backspace (unable to remove formatting) ==== |
| 71 | |
| 72 | Related issues: #8438, #11592, #11483 |
| 73 | |
| 74 | 1. `<p>x<strong>y^</strong></p>` |
| 75 | 2. Backspace. |
| 76 | 3. Type “z”. |
| 77 | 4. `<p>x<b>z^</b></p>` |
| 78 | |
| 79 | ==== Backspace (underlined link becomes `<u>`) ==== |
| 80 | |
| 81 | Related issues: #11592 |
| 82 | |
| 83 | 1. `<p><a href="http://foo">[foo]</a>bar</p>` |
| 84 | 2. Backspace. |
| 85 | 3. Type "foo". |
| 86 | 4. `<p><u>foo^</u>bar</p>` |
| 87 | 5. ''Frown'' |
| 88 | 6. ''Grin'' |
| 89 | |
| 90 | '''Note''': This case uncovers the algorithm used in Webkit. |
| 91 | The engine attempts to preserve the style no matter how ridiculous it would be – it uses `<u>` because it is the closest style, |
| 92 | which corresponds visually with underlined link. |
| 93 | |
| 94 | ==== Del (unable to remove formatting) ==== |
| 95 | |
| 96 | Related issues: #8439, #8440 |
| 97 | |
| 98 | 1. `<p>foo</p>` |
| 99 | 2. CTRL+A. |
| 100 | 3. Bold. |
| 101 | 4. DEL. |
| 102 | 5. Type “bar”. |
| 103 | 6. `<p><b>bar^</b></p>` |
| 104 | |
| 105 | === <span> created while splitting elements (DnD), extra === |
| 106 | Related issues: #10515 |
| 107 | |
| 108 | 1. Set the following HTML |
| 109 | {{{ |
| 110 | <p> |
| 111 | <span style="font-size:28px"> |
| 112 | foo |
| 113 | <strong>[bar]</strong> |
| 114 | <em>bam</em> |
| 115 | bang |
| 116 | </span> |
| 117 | </p> |
| 118 | }}} |
| 119 | 2. Drag `[bar]` into `ba|m` |
| 120 | 3. `editor.getData()`. |
| 121 | 4. See the result. |
| 122 | {{{ |
| 123 | <p> |
| 124 | <span style="font-size:28px"> |
| 125 | foo |
| 126 | <em>ba</em> |
| 127 | </span> |
| 128 | <strong style="font-size:28px; line-height:44.79999923706055px">bar</strong> |
| 129 | <em style="font-size:28px; line-height:1.6">m</em> |
| 130 | <span style="font-size:28px; line-height:1.6"> bang</span> |
| 131 | </p> |
| 132 | }}} |
| 133 | 5. Then WYSIWYG->Source->WYSIWYG. |
| 134 | 6. ACF brings the ultimate destruction. |
| 135 | {{{ |
| 136 | <p> |
| 137 | <span style="font-size:28px">foo <em>ba</em></span> |
| 138 | <strong>bar</strong> |
| 139 | <em>m</em> |
| 140 | <span style="font-size:28px"> bang</span> |
| 141 | </p> |
| 142 | }}} |