re-enable relative to absolute URL conversion for remote translations

This commit is contained in:
Russell Ballestrini 2025-07-11 20:54:56 -04:00
parent e0a784c073
commit 9550fb8e94

View file

@ -503,10 +503,12 @@ export async function translateHTML(htmlContent, targetLanguage, sourceUrl = nul
throw new Error("Unable to extract meaningful content from provided HTML.");
}
// Skip URL conversion during chunking to avoid performance overhead
// We'll add base tag instead which is more efficient
// Convert relative URLs to absolute if sourceUrl is provided
let processedContent = htmlContent;
console.log('Skipping URL conversion for chunked translation - will use base tag instead');
if (sourceUrl) {
processedContent = convertRelativeToAbsolute(htmlContent, sourceUrl);
console.log('Converted relative URLs using base URL:', sourceUrl);
}
// Use actual token limits instead of character limits
const maxTokens = getSelectedModelMaxTokens();