Regular expression for matching HTML empty conditional comments
Table of Contents
npm i regex-empty-conditional-comments
The default is exported, so instead of "
emptyCondCommentRegex" below, you can name the consumed function however you want.
Consume via a
const emptyCondCommentRegex = ;
or as an ES Module:
or for web pages, as a production-ready minified script file (so-called "UMD build"), straight from CDN:
// in which case you get a global variable "regexEmptyConditionalComments" which you consume like this:const emptyCondCommentRegex = regexEmptyConditionalComments;
This package has three builds in
|Main export - CommonJS version, transpiled to ES5, contains
|ES module build that Webpack/Rollup understands. Untranspiled ES6 code with
|UMD build for browsers, transpiled, minified, containing
const emptyCondCommentRegex = ;// empty comment which was meant to target Outlook-onlyt;//=> true// empty comment which was meant to target non-Outlook-onlyt;//=> truet;//=> falset;//=> false0;//=> '<!--[if !mso]><![endif]-->'`<html> <!--[if !mso]><![endif]--> <title>text</title> <!--[if gte mso 9]><xml><![endif]-->`;//=> ['<!--[if !mso]><![endif]-->']
- If you see an error, raise an issue.
- If you want a new feature but can't code it up yourself, also raise an issue. Let's discuss it.
- If you tried to use this package, but something didn't work out, also raise an issue. We'll try to help.
- If you want to contribute some code, fork the monorepo via GitLab, then write code, then file a pull request on GitLab. We'll merge it in and release.
In monorepo, npm libraries are located in
packages/ folder. Inside, the source code is located either in
src/ folder (normal npm library) or in the root,
cli.js (if it's a command-line application).
The npm script "
"dev": "rollup -c --dev" builds the development version retaining all
console.logs with row numbers. It's handy to have js-row-num-cli installed globally so you can automatically update the row numbers on all
Copyright (c) 2015-2020 Roy Revelt and other contributors