forked from akai/readest
fix: normalize input text by removing newlines to prevent translation glitches (#1210)
This commit is contained in:
@@ -76,7 +76,8 @@ const DeepLPopup: React.FC<DeepLPopupProps> = ({
|
||||
setTranslation(null);
|
||||
|
||||
try {
|
||||
const result = await translate([text]);
|
||||
const input = text.replaceAll('\n', ' ').trim();
|
||||
const result = await translate([input]);
|
||||
const translatedText = result[0];
|
||||
const detectedSource = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user