From ba837601571fd23da06fc51e22bd74aa7798b7b9 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Wed, 23 Jan 2019 13:49:41 -0500 Subject: [PATCH] fix newlines --- extensions/bingtranslate.cpp | 2 +- extensions/googletranslate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/bingtranslate.cpp b/extensions/bingtranslate.cpp index f21f73c..f935613 100644 --- a/extensions/bingtranslate.cpp +++ b/extensions/bingtranslate.cpp @@ -154,7 +154,7 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) if (translation[i] == L'\\') { translation[i] = 0x200b; - if (translation[i + 1] == L'r') translation[i + 1] = L'\r'; + if (translation[i + 1] == L'r') translation[i + 1] = 0x200b; // for some reason \r gets displayed as a newline if (translation[i + 1] == L'n') translation[i + 1] = L'\n'; if (translation[i + 1] == L't') translation[i + 1] = L'\t'; } diff --git a/extensions/googletranslate.cpp b/extensions/googletranslate.cpp index 851c541..31ee689 100644 --- a/extensions/googletranslate.cpp +++ b/extensions/googletranslate.cpp @@ -200,7 +200,7 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) if (translation[i] == L'\\') { translation[i] = 0x200b; - if (translation[i + 1] == L'r') translation[i + 1] = L'\r'; + if (translation[i + 1] == L'r') translation[i + 1] = 0x200b; // for some reason \r gets displayed as a newline if (translation[i + 1] == L'n') translation[i + 1] = L'\n'; if (translation[i + 1] == L't') translation[i + 1] = L'\t'; }