add space to task regex and disable xhtml for gfm testing
This commit is contained in:
parent
409cb0d841
commit
aa73bb6ea7
@ -366,11 +366,11 @@ Lexer.prototype.token = function(src, top) {
|
||||
}
|
||||
|
||||
// Check for task list items
|
||||
istask = /^\[[ xX]\]/.test(item);
|
||||
istask = /^\[[ xX]\] /.test(item);
|
||||
ischecked = undefined;
|
||||
if (istask) {
|
||||
ischecked = item[1] !== ' ';
|
||||
item = item.replace(/^\[[ xX]\] */, '');
|
||||
item = item.replace(/^\[[ xX]\] +/, '');
|
||||
}
|
||||
|
||||
this.tokens.push({
|
||||
|
@ -15,8 +15,7 @@ Messenger.prototype.test = function(spec, section, ignore) {
|
||||
var shouldFail = ~ignore.indexOf(spec.example);
|
||||
it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() {
|
||||
var expected = spec.html;
|
||||
var usexhtml = typeof spec.xhtml === 'boolean' ? spec.xhtml : true;
|
||||
var actual = marked(spec.markdown, { headerIds: false, xhtml: usexhtml });
|
||||
var actual = marked(spec.markdown, { headerIds: false, xhtml: false });
|
||||
since(messenger.message(spec, expected, actual)).expect(
|
||||
htmlDiffer.isEqual(expected, actual)
|
||||
).toEqual(!shouldFail);
|
||||
|
@ -51,15 +51,13 @@
|
||||
"section": "Task list items",
|
||||
"html": "<ul>\n<li><input disabled=\"\" type=\"checkbox\"> foo</li>\n<li><input checked=\"\" disabled=\"\" type=\"checkbox\"> bar</li>\n</ul>",
|
||||
"markdown": "- [ ] foo\n- [x] bar",
|
||||
"example": 272,
|
||||
"xhtml": false
|
||||
"example": 272
|
||||
},
|
||||
{
|
||||
"section": "Task list items",
|
||||
"html": "<ul>\n<li><input checked=\"\" disabled=\"\" type=\"checkbox\"> foo\n<ul>\n<li><input disabled=\"\" type=\"checkbox\"> bar</li>\n<li><input checked=\"\" disabled=\"\" type=\"checkbox\"> baz</li>\n</ul>\n</li>\n<li><input disabled=\"\" type=\"checkbox\"> bim</li>\n</ul>",
|
||||
"markdown": "- [x] foo\n - [ ] bar\n - [x] baz\n- [ ] bim",
|
||||
"example": 273,
|
||||
"xhtml": false
|
||||
"example": 273
|
||||
},
|
||||
{
|
||||
"section": "Strikethrough",
|
||||
|
Loading…
x
Reference in New Issue
Block a user