Commit 4604ffb
fix: metadata.js Keywords field silently mangled multi-word keywords on round-trip
Loading a saved PDF re-split the Keywords string by whitespace and rejoined
with commas for display, then saving re-split by comma and joined with a
single space via pdf-lib's setKeywords(). Any keyword containing an internal
space (e.g. "machine learning") was silently torn into separate keywords
("machine", "learning") after a single save+reload cycle, with no warning.
Fixed by treating Keywords as the single free-text field it actually is:
display/edit the raw string verbatim, and pass it to setKeywords() as a
single-element array so pdf-lib's internal join(" ") is a no-op.1 parent fd6f351 commit 4604ffb
1 file changed
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| |||
0 commit comments