feat: Adsterra integration, code splitting, cleanup, Onidel affiliate

This commit is contained in:
dwindown
2026-02-18 16:50:45 +07:00
parent 7ba289be5c
commit 9dc3285adb
40 changed files with 352 additions and 2933 deletions

View File

@@ -58,8 +58,6 @@ const MarkdownEditor = () => {
const language = token.lang || '';
const normalizedLang = language ? language.toLowerCase().trim() : '';
console.log('Code block detected:', { language, normalizedLang, codeLength: codeString.length });
let highlightedCode = codeString;
// Apply syntax highlighting
@@ -67,18 +65,14 @@ const MarkdownEditor = () => {
try {
const result = hljs.highlight(codeString, { language: normalizedLang });
highlightedCode = result.value;
console.log('Highlighted with language:', normalizedLang);
} catch (e) {
console.error(`Highlight error for ${normalizedLang}:`, e);
highlightedCode = codeString;
}
} else {
try {
const result = hljs.highlightAuto(codeString);
highlightedCode = result.value;
console.log('Auto-highlighted, detected:', result.language);
} catch (e) {
console.error('Auto-highlight error:', e);
highlightedCode = codeString;
}
}
@@ -136,7 +130,6 @@ const MarkdownEditor = () => {
ADD_ATTR: ['data-code-id', 'title', 'id', 'type', 'checked', 'disabled']
});
} catch (e) {
console.error('Markdown parse error:', e);
return '<p>Error parsing markdown</p>';
}
};
@@ -173,7 +166,7 @@ const MarkdownEditor = () => {
button.textContent = originalText;
}, 2000);
}).catch(err => {
console.error('Failed to copy:', err);
// Failed to copy
});
}
return;
@@ -818,7 +811,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
response = await fetch(urlToFetch);
} catch (corsError) {
// If CORS error, try with CORS proxy
console.log('CORS error, trying with proxy...');
response = await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(urlToFetch)}`);
}
@@ -855,7 +847,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
});
} catch (err) {
console.error('Fetch error:', err);
setError(`Failed to fetch from URL: ${err.message}`);
} finally {
setFetching(false);
@@ -1494,7 +1485,6 @@ ${html}
html2pdf().set(opt).from(wrapper).save().then(() => {
setError('');
}).catch((err) => {
console.error('PDF generation error:', err);
setError('Failed to generate PDF');
});
};