You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/html-to-plaintext/test/html-to-plaintext.test.js
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,36 @@ describe('Html to Plaintext', function () {
88
88
});
89
89
});
90
90
91
+
describe('New lines and format headers',function(){
92
+
it('Strips excessive new lines and formats headers',function(){
93
+
consthtml='<p>Some ordinary text</p>\n\n\n\n<p>Should not be way far apart from earlier text.</p>';
94
+
constexpected='Some ordinary text\n\nShould not be way far apart from earlier text.';
95
+
const{email}=getEmailandExcert(html);
96
+
assert.equal(email,expected);
97
+
});
98
+
99
+
it('Check header formatting',function(){
100
+
consthtml='<h1>Header One</h1>\n<p>What should I even write about?</p><p>And more</p><h2>With Header Two</h2><p>What about code?<h3>And Header Three</h3><p>Good bye</p>';
101
+
constexpected='Header One\n\nWhat should I even write about?\n\nAnd more\n\n\nWith Header Two\n\nWhat about code?\n\n\nAnd Header Three\n\nGood bye';
0 commit comments