§ Quick Take
import { strict as assert } from "assert";
import { Linter } from "emlint";
const linter = new Linter();
// Correct "not" type Outlook conditional would be:
// <!--[if !mso]><!-->
// <img src="fallback"/>
// <!--<![endif]-->
// We have a "not" type opening but "only" type
// closing:
const messages = linter.verify(
`<!--[if !mso]><!-->
<img src="fallback"/>
<![endif]-->`,
{
rules: {
all: 2,
},
}
);
assert.deepEqual(messages, [
{
line: 3,
column: 1,
severity: 2,
ruleId: "comment-mismatching-pair",
message: `Add "<!--".`,
idxFrom: 44,
idxTo: 56,
fix: {
ranges: [[44, 44, "<!--"]],
},
keepSeparateWhenFixing: true,
},
]);
§ Notice
EMLint is currently being developed. Please come back later.
§ Changelog
See it in the monorepo , on GitHub.
§ Contributing
To report bugs or request features or assistance, raise an issue on GitHub .
Any code contributions welcome! All Pull Requests will be dealt promptly.
§ Licence
Copyright © 2010–2021 Roy Revelt and other contributors
Related packages:
📦 codsen-parser 0.10.3
Parser aiming at broken or mixed code, especially HTML & CSS
📦 codsen-tokenizer 5.2.0
HTML and CSS lexer aimed at code with fatal errors, accepts mixed coding languages
📦 detergent 7.0.6
Extracts, cleans and encodes text
📦 html-crush 4.1.0
Minifies HTML/CSS: valid or broken, pure or mixed with other languages
📦 email-comb 5.0.6
Remove unused CSS from email templates
📦 string-strip-html 8.2.3
Strips HTML tags from strings. No parser, accepts mixed sources
📦 json-variables 10.0.6
Resolves custom-marked, cross-referenced paths in parsed JSON