diff --git a/src/Tokenizer.js b/src/Tokenizer.js index e7d71fe027..20f122332f 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -278,11 +278,13 @@ module.exports = class Tokenizer { } // Check for task list items - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); + if (this.options.gfm) { + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } } list.items.push({ diff --git a/test/specs/new/list_tasks_non_gfm.html b/test/specs/new/list_tasks_non_gfm.html new file mode 100644 index 0000000000..dfa23220e1 --- /dev/null +++ b/test/specs/new/list_tasks_non_gfm.html @@ -0,0 +1,5 @@ +