@social-mail/social-mail-web-server 1.8.491 → 1.8.493

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.491",
3
+ "version": "1.8.493",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -162,7 +162,6 @@ export default class WebSiteContentService
162
162
  .thenByDescending({ top }, (p) => (x) => x.name === p.top)
163
163
  .first());
164
164
  if (!child) {
165
- console.warn(JSON.stringify({ top, error: "not found", folderID }));
166
165
  return null;
167
166
  }
168
167
  if (paths.length === 0) {
@@ -136,6 +136,19 @@ async function inlineCSS(window, document: Document){
136
136
  return result;
137
137
  };
138
138
 
139
+ function changeImageType(e: Element, names = ["src", "large-src"]) {
140
+ for(const name of names) {
141
+ const value = e.getAttribute(name);
142
+ if (!value) {
143
+ continue;
144
+ }
145
+ const replaced = value.replace("/webp", "/jpg").replaceAll(".webp", ".jpg");
146
+ if (replaced !== value) {
147
+ e.setAttribute(name, replaced);
148
+ }
149
+ }
150
+ }
151
+
139
152
 
140
153
  async function flattenStyleSheets() {
141
154
  const includes = document.querySelectorAll(`link[rel="stylesheet"]`);
@@ -173,6 +186,7 @@ async function inlineCSS(window, document: Document){
173
186
  }
174
187
  }
175
188
  }
189
+ changeImageType(e);
176
190
  }
177
191
  adoptedStyle.textContent = styles.join("\n");
178
192
  document.head.appendChild(adoptedStyle);
@@ -181,6 +195,7 @@ async function inlineCSS(window, document: Document){
181
195
  return () => remove.forEach((x)=>x.remove());
182
196
  }
183
197
 
198
+
184
199
  async function flattenStyler(rules) {
185
200
 
186
201
  const stylerPrefix = "styler-";
@@ -243,4 +258,4 @@ async function inlineCSS(window, document: Document){
243
258
  s.remove();
244
259
  }
245
260
 
246
- }
261
+ }