Skip to content

Commit cbeb319

Browse files
committedOct 27, 2020
test: contents are split with '<' in comment, issue #18
1 parent d89bf85 commit cbeb319

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎test/test.js

+14
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,18 @@ describe('PostHTML-Parser test', function() {
204204
{ tag: 'mySuperTag' }
205205
]);
206206
});
207+
208+
it('should be parse simple contents are split with "<" in comment', function() {
209+
const html = `<a> /* width < 800px */ <hr /> test</a>`
210+
expect(parser(html)).to.eql([
211+
{ tag: 'a', content: [' /* width < 800px */ ', {tag: 'hr'}, ' test'] }
212+
]);
213+
});
214+
215+
it('should be parse style contents are split with "<" in comment', function() {
216+
const html = `<style> /* width < 800px */ @media (max-width: 800px) { /* selectors */} </style>`
217+
expect(parser(html)).to.eql([
218+
{ tag: 'style', content: [' /* width < 800px */ @media (max-width: 800px) { /* selectors */} '] }
219+
]);
220+
});
207221
});

0 commit comments

Comments
 (0)