-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
7 lines (6 loc) · 3.96 KB
/
main.js
1
2
3
4
5
6
7
const { convert } = require('html-to-text');
const html = `<html><head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><style type=\"text/css\">\r\n<!--\r\n.MLetter\r\n\t{font-family:Tahoma,Verdana,Arial,sans-serif;\r\n\tfont-size:14px;\r\n\tcolor:#454545;\r\n\tline-height:normal;\r\n\tdirection:ltr;\r\n\tpadding:0px 2px}\r\n.MLetter .MText\r\n\t{font-size:14px;\r\n\tline-height:20px}\r\n.MLetter .MSubhead\r\n\t{font-family:'Segoe UI Web Semibold','Segoe UI Web Regular','Segoe UI','Helvetica Neue Medium',Arial;\r\n\tcolor:#0072C6;\r\n\tfont-size:19px;\r\n\tline-height:25px}\r\n.MLetter .MPreHeader\r\n\t{display:none}\r\n.MLetter .MPreHeader .MText\r\n\t{color:#ffffff}\r\n.MLetter .MHeader\r\n\t{background-color:#0072C6;\r\n\tcolor:#ffffff;\r\n\tpadding:50px 30px 50px}\r\n.MLetter .MHeader .MTitle\r\n\t{font-family:'Segoe UI Web Light','Segoe UI Light','Segoe UI Web Regular','Segoe UI','Helvetica Neue UltraLight',Arial;\r\n\tfont-size:40px;\r\n\tline-height:40px}\r\n.MLetter .MContent .MPara\r\n\t{padding-top:30px}\r\n.MLetter .MContent a\r\n\t{color:#0072C6;\r\n\ttext-decoration:none}\r\n.MLetter .MFooter\r\n\t{background-color:#bbbbbb;\r\n\tcolor:#ffffff;\r\n\tfont-family:Arial;\r\n\tfont-size:11px;\r\n\tpadding:30px}\r\n.MLetter .MFooter .MPara\r\n\t{padding-top:10px}\r\n.MLetter .MFooter a\r\n\t{color:#ffffff}\r\n-->\r\n</style></head><body><div class=\"MLetter\"><div class=\"MPreHeader\" style=\"padding:17px 30px 23px\"><div><-- Update the width and height when the final logo is available --> <img width=\"0px\" height=\"0px\" src=\"\" style=\"float:left\"> </div><div class=\"MText\">Complete these 4 simple steps to get started.</div></div><div class=\"MHeader\"><div class=\"MTitle\">Hello, and welcome to Outlook.com </div><div class=\"MSubhead\" style=\"color:#ffffff; padding-top:15px\">To get started, let's set up your inbox so you can start emailing and more. </div></div><div class=\"MContent\" style=\"padding:22px 30px\"><div class=\"MPara\"><div class=\"MSubhead\">Bring in your email </div><div class=\"MText\">Have another email account like Gmail? Bring your email into Outlook.com so it's easier to keep up with all of your messages. </div><a href=\"http://g.live.com/9wc9en-us/w_letter1\">Set it up</a> </div><div class=\"MPara\"><div class=\"MSubhead\">Connect to Facebook and Twitter </div><div class=\"MText\">See your friends' Facebook updates and Tweets in your inbox rather than ads, and keep all your contact information in sync so you never have to update your address book. </div><a href=\"http://g.live.com/9wc9en-us/w_letter2\">Connect now</a> </div><div class=\"MPara\"><div class=\"MSubhead\">Import your contacts </div><div class=\"MText\">Save time hunting for email addresses. Quickly import your contacts from other services like Facebook, LinkedIn and Gmail. </div><a href=\"http://g.live.com/9wc9en-us/w_letter3\">Add contacts</a> </div><div class=\"MPara\"><div class=\"MSubhead\">Get Outlook.com on your mobile phone </div><div class=\"MText\">It's quick and easy to set up Outlook.com on your mobile phone so you can access your email wherever you are. Outlook.com is available on Windows Phone, iPhone, Android and more. </div><a href=\"http://g.live.com/9wc9en-us/w_letter4\">Set it up</a> </div><div class=\"MSubhead\" style=\"padding-top:50px\">Sound easy? It is. Thanks for signing up. </div><div class=\"MText\" style=\"padding-bottom:35px\">The Outlook.com Team </div></div><div class=\"MFooter\"><div>Microsoft respects your privacy. To learn more, please read our online <a href=\"http://go.microsoft.com/fwlink/p/?LinkId=253457\">Privacy Statement</a>. </div><div class=\"MPara\">Microsoft Corporation, One Microsoft Way, Redmond, WA 98052-6399, USA \u00a9 2015 Microsoft Corporation. All rights reserved. </div></div></div><img alt=\"\" width=\"1\" height=\"1\" src=\"http://switch.atdmt.com/action/WL_WL_EN_US_FY09_HotmailMemberLetter\" style=\"display:none\"> </body></html>`;
const text = convert(html, {
wordwrap: 130
});
console.log(text);