Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed
https://markdown-it.github.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
465 B
22 lines
465 B
1 year ago
|
import { assert } from 'chai';
|
||
|
import Token from '../lib/token.js';
|
||
10 years ago
|
|
||
|
|
||
|
describe('Token', function () {
|
||
|
|
||
|
it('attr', function () {
|
||
|
var t = new Token('test_token', 'tok', 1);
|
||
|
|
||
|
assert.strictEqual(t.attrs, null);
|
||
|
assert.equal(t.attrIndex('foo'), -1);
|
||
|
|
||
|
t.attrPush([ 'foo', 'bar' ]);
|
||
|
t.attrPush([ 'baz', 'bad' ]);
|
||
|
|
||
|
assert.equal(t.attrIndex('foo'), 0);
|
||
|
assert.equal(t.attrIndex('baz'), 1);
|
||
|
assert.equal(t.attrIndex('none'), -1);
|
||
|
});
|
||
|
|
||
|
});
|