Finds all conditional comments in a string
Install
$ npm install find-conditional-comments
Usage
const findConditionalComments = require('find-conditional-comments');
const html = `
<!--[if mso]>
Hello, Microsoft Outlook!
<![endif]-->
`
findConditionalComments(html);
API
Returns an Array of Objects for each comment with the following properties:
open
String
Opening portion of the conditional comment.
close
String
Closing portion of the conditional comment.
downlevel
String
Either hidden
or revealed
. Learn more.
range
Array
A range array containing the start and end indices of the comment.
Related