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.

24 lines
487 B

'use strict';
var assert = require('chai').assert;
var Token = require('../lib/token');
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);
});
});