Skip to content

Commit 219fc16

Browse files
committed
remove style data from <span> tags
closes #15 and #14
1 parent a3abc36 commit 219fc16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

evernote2onenote/src/MainFrm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public partial class MainFrm : Form
5858
private readonly string _cmdNoteBook = "";
5959
private DateTime _cmdDate = new DateTime(0);
6060

61-
private readonly Regex _rxStyle = new Regex("(?<text>\\<div.)style=\\\"[^\\\"]*\\\"", RegexOptions.IgnoreCase);
61+
private readonly Regex _rxStyle = new Regex("(?<text>\\<(?:div|span).)style=\\\"[^\\\"]*\\\"", RegexOptions.IgnoreCase);
6262
private readonly Regex _rxCdata = new Regex(@"<!\[CDATA\[<\?xml version=[""']1.0[""'][^?]*\?>", RegexOptions.IgnoreCase);
6363
private readonly Regex _rxCdata2 = new Regex(@"<!\[CDATA\[<!DOCTYPE en-note \w+ ""https?://xml.evernote.com/pub/enml2.dtd"">", RegexOptions.IgnoreCase);
6464
private readonly Regex _rxCdataInner = new Regex(@"\<\!\[CDATA\[(?<text>.*)\]\]\>", RegexOptions.IgnoreCase | RegexOptions.Singleline);
@@ -554,7 +554,7 @@ private void ImportNotesToOnenote(List<Note> notesEvernote, string exportFile)
554554
htmlBody = _rxBodyEnd.Replace(htmlBody, "</body>");
555555
htmlBody = _rxBodyEmpty.Replace(htmlBody, "<body></body>");
556556
htmlBody = htmlBody.Trim();
557-
htmlBody = @"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN""><head></head>" + htmlBody;
557+
htmlBody = @"<!DOCTYPE html><head></head>" + htmlBody;
558558

559559
var emailBody = htmlBody;
560560
emailBody = _rxDate.Replace(emailBody, "Date: " + note.Date.ToString("ddd, dd MMM yyyy HH:mm:ss K"));

0 commit comments

Comments
 (0)