decant-core 1.2.5 → 1.2.6
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/ai/google_search_ai.js +3 -2
- package/package.json +1 -1
package/ai/google_search_ai.js
CHANGED
|
@@ -14,11 +14,12 @@ export function sanitizeResponseContainer(container) {
|
|
|
14
14
|
: [];
|
|
15
15
|
unwanted.forEach((el) => el.remove());
|
|
16
16
|
|
|
17
|
-
// 2. Remove base64 inline images to prevent megabyte-scale text walls in markdown exports
|
|
17
|
+
// 2. Remove base64 inline images to prevent megabyte-scale text walls in markdown exports,
|
|
18
|
+
// while preserving math LaTeX equation images marked with data-xpm-latex
|
|
18
19
|
const images = clone.querySelectorAll ? clone.querySelectorAll("img") : [];
|
|
19
20
|
images.forEach((img) => {
|
|
20
21
|
const src = img.getAttribute("src") || "";
|
|
21
|
-
if (src.startsWith("data:image/")) {
|
|
22
|
+
if (src.startsWith("data:image/") && !img.hasAttribute("data-xpm-latex")) {
|
|
22
23
|
img.remove();
|
|
23
24
|
}
|
|
24
25
|
});
|