nolimit-x 1.0.25 → 1.0.26
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 +1 -1
- package/src/placeholders.js +6 -4
package/package.json
CHANGED
package/src/placeholders.js
CHANGED
|
@@ -96,20 +96,22 @@ const dynamicPlaceholders = [
|
|
|
96
96
|
// Favicon placeholder with optional custom URL
|
|
97
97
|
{
|
|
98
98
|
pattern: /\[\[.*FAVICON.*\]\]/g,
|
|
99
|
-
handler: async (match,
|
|
100
|
-
|
|
99
|
+
handler: async (match, ...args) => {
|
|
100
|
+
// Try to find customUrl and email from args
|
|
101
|
+
let customUrl = args[0];
|
|
102
|
+
// The email should always be the last argument
|
|
103
|
+
let email = args[args.length - 3] || args[args.length - 1];
|
|
104
|
+
if (customUrl && typeof customUrl === 'string' && customUrl.trim() && !customUrl.includes('FAVICON')) {
|
|
101
105
|
return customUrl.trim();
|
|
102
106
|
}
|
|
103
107
|
if (!email) {
|
|
104
108
|
console.error('FAVICON placeholder: No email provided!');
|
|
105
|
-
// Return a default favicon
|
|
106
109
|
return 'https://www.google.com/s2/favicons?sz=32&domain_url=default.com';
|
|
107
110
|
}
|
|
108
111
|
const domain = utils.getDomainFromEmail(email);
|
|
109
112
|
const faviconUrl = await utils.fetchFavicon(domain);
|
|
110
113
|
const dataUri = await utils.fetchFaviconBase64(domain);
|
|
111
114
|
console.log('FAVICON placeholder:', { email, domain, faviconUrl, dataUriLength: dataUri.length });
|
|
112
|
-
// Fallback: if dataUri is empty, use the external favicon URL
|
|
113
115
|
return dataUri || faviconUrl || 'https://www.google.com/s2/favicons?sz=32&domain_url=default.com';
|
|
114
116
|
}
|
|
115
117
|
},
|