isaacs / minimatch

a glob matcher in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slashes in input string breaks matching

terion-name opened this issue · comments

import {minimatch} from 'minimatch';

const text = '<h1>123</h1>';

console.log(minimatch(text, '<h1>123</h1>')) // true
console.log(minimatch(text, '*123*')) // false
console.log(minimatch(text, '*')) // false

// BUT
const text2 = '<h1>123<h1>'; // remove slash

console.log(minimatch(text, '*123*')) // true
console.log(minimatch(text, '*')) // true

seems it's by design

This is for matching file path strings, not html.