From a6042d53cbd1403304edb1fd2f3efe0ebf47319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=BCng?= Date: Mon, 15 Jan 2024 19:02:05 +0100 Subject: [PATCH] patch from Endre Szesztay: -the first empty rows after a paragraph disappeared during the transfer. It happens in the onenote api, but adding a   before
seems to solve it -simple formatting disappeared, like text and background color. I think it was not intentional, i corrected it and for me it works. --- evernote2onenote/src/MainFrm.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/evernote2onenote/src/MainFrm.cs b/evernote2onenote/src/MainFrm.cs index 91f1c1d..0770a76 100644 --- a/evernote2onenote/src/MainFrm.cs +++ b/evernote2onenote/src/MainFrm.cs @@ -74,7 +74,7 @@ public partial class MainFrm : Form private readonly Regex _rxNote = new Regex("(.+)", RegexOptions.IgnoreCase); private readonly Regex _rxComment = new Regex("", RegexOptions.IgnoreCase); private readonly Regex _rxDtd = new Regex(@"", RegexOptions.IgnoreCase | RegexOptions.Compiled); - + private readonly Regex _rxBrOnly = new Regex(" notesEvernote, string exportFile) note.Attachments.Clear(); htmlBody = _rxFontFamily.Replace(htmlBody, string.Empty); + // Insert   before
to newline being effective + htmlBody = _rxBrOnly.Replace(htmlBody, " $&"); htmlBody = _rxStyle.Replace(htmlBody, delegate (Match m) { if (m.Value.Contains("--en-codeblock:true;")) return m.Result("

${text}") + "style=\"background-color:#B0B0B0; font-family: Consolas, Courier New, monospace; font-size: 15px;\""; - return m.Result("${text}"); + return m.Result("$&"); // this "$&" restores the original row, so formatting remains in the xml }); htmlBody = htmlBody.Replace("
", "

");
                             htmlBody = htmlBody.Replace("
", "


");