mirror of
https://github.com/danog/inline-critical.git
synced 2025-01-22 13:52:54 +01:00
minor regex fix
This commit is contained in:
parent
35058fa8fd
commit
f724f3f91b
6
index.js
6
index.js
@ -62,9 +62,9 @@ function read(file) {
|
||||
* @param $el
|
||||
*/
|
||||
function getIndent(html, $el) {
|
||||
var regName = new RegExp(_.get($el, 'name'));
|
||||
var regHref = new RegExp(_.get($el, 'attribs.href'));
|
||||
var regRel = new RegExp(_.get($el, 'attribs.rel'));
|
||||
var regName = new RegExp(_.escapeRegExp(_.get($el, 'name')));
|
||||
var regHref = new RegExp(_.escapeRegExp(_.get($el, 'attribs.href')));
|
||||
var regRel = new RegExp(_.escapeRegExp(_.get($el, 'attribs.rel')));
|
||||
var lines = _.filter(html.split(/[\r\n]+/), function (line) {
|
||||
return regName.test(line) && regHref.test(line) && regRel.test(line);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user