Vitepress

This commit is contained in:
Robert Jelic
2025-02-10 06:53:23 +01:00
parent 3818128521
commit b0a4a6da9c
2428 changed files with 1005324 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
'use strict';
describe('mark with regular expression and ignoreGroups', function() {
var $ctx1, $ctx2;
beforeEach(function(done) {
loadFixtures('regexp/ignore-groups.html');
$ctx1 = $('.regexp-ignore-groups > div:first-child');
$ctx2 = $('.regexp-ignore-groups > div:last-child');
new Mark($ctx1[0]).markRegExp(/(Lor)([^]?m[\s]*)(ipsum)/gmi, {
'done': function() {
new Mark($ctx2[0]).markRegExp(/(Lor)([^]?m[\s]*)(ipsum)/gmi, {
'ignoreGroups': 2,
'done': done
});
}
});
});
it('should silently ignore groups when disabled', function() {
expect($ctx1.find('mark')).toHaveLength(4);
$ctx1.find('mark').each(function() {
expect($(this).text()).toBe('Lorem ipsum');
});
});
it('should ignore specified groups when enabled', function() {
expect($ctx2.find('mark')).toHaveLength(4);
$ctx2.find('mark').each(function() {
expect($(this).text()).toBe('ipsum');
});
});
});