Commit 97c18da
authored
* Update `SwiftSoup` from `2.7.5` to `2.13.6`
Removes the `'swiftsoup': found 4 file(s) which are unhandled` warning
emitted during `swift test`. Upstream dropped the four stray `Info*.plist`
files from the package's `Sources/` directory in 2.8.2, so any release past
our pin resolves it — this takes us to the latest, 2.13.6.
No breaking API changes across 2.8–2.13.6 (Swift 5.9+ floor, satisfied). Our
usage — `parse`, `parseBodyFragment`, `clean`, `Element`/`Elements`/`Comment`/
`Entities` — is unchanged.
* Fix Gutenberg upload processors under `SwiftSoup` 2.13.6
`SwiftSoup` 2.12+ serializes unchanged nodes from a cached slice of the
original source, so the `attr()` mutations the media upload processors
make on nested elements weren't reflected in the output — only the mutated
node is marked dirty, not its ancestors, so `body.html()` re-emitted stale
bytes and uploaded media kept their local `file://` URLs and temp IDs.
`GutenbergContentParser.html()` now replaces each top-level element with a
copy to force a fresh render of the mutated subtrees, while emitting the
surrounding comment/text nodes (Gutenberg block delimiters) from their
original bytes. Output is byte-for-byte identical to the previous behavior.
All Gutenberg upload processor tests pass on 2.13.6.
* Add `GutenbergContentParser` tests for its serialization contract
Extends the existing suite with the coverage the SwiftSoup 2.13.6 fix
relies on but that was missing. The prior element-mutation test only
mutates a top-level node, whose change survives serialization even with
the 2.12+ regression; the new tests mutate nested and deeply-nested
elements, which are the paths that actually broke.
Also pins the serialization contract that shifts across SwiftSoup
versions — void-element normalization, entity / raw-text / preformatted /
unicode fidelity, `html()` idempotence — and the malformed-JSON and
sorted-key attribute handling.
* Extract Gutenberg content processors into a `GutenbergProcessors` module
Moves the SwiftSoup-based Gutenberg code — `GutenbergContentParser`, the
`GutenbergProcessor` protocol, and the image/gallery/file upload
processors — out of the app target into a new `GutenbergProcessors`
module so its tests run under `swift test` on macOS instead of a full
iOS app build. The Aztec-based processors stay in the app; they depend on
UIKit and can't run cross-platform.
Wiring is entirely in Package.swift, no project changes: the module is
added to `keystoneDependencies` (how the app links it), a cross-platform
test target is added to the root package, and the target is registered in
the unit-test plan. `PostCoordinator` is the only consumer.
Runs via `swift test --filter GutenbergProcessorsTests`.
1 parent 227641a commit 97c18da
17 files changed
Lines changed: 452 additions & 242 deletions
File tree
- Modules
- Sources/GutenbergProcessors
- Tests/GutenbergProcessorsTests
- Tests/KeystoneTests
- Tests/Features/Gutenberg
- WordPress/Classes/Services
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
| |||
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
403 | 417 | | |
404 | 418 | | |
405 | 419 | | |
| |||
484 | 498 | | |
485 | 499 | | |
486 | 500 | | |
| 501 | + | |
487 | 502 | | |
488 | 503 | | |
489 | 504 | | |
| |||
Lines changed: 48 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
128 | 144 | | |
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
139 | 156 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
145 | 162 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
152 | 174 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 175 | | |
158 | | - | |
159 | 176 | | |
160 | 177 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments