re-enable relative to absolute URL conversion for remote translations
This commit is contained in:
parent
e0a784c073
commit
9550fb8e94
1 changed files with 5 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue