diff --git a/lib/renderer.js b/lib/renderer.js index a8a1d2a..7bc02e3 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -17,20 +17,6 @@ function Renderer() { require('util').inherits(Renderer, MarkedRenderer); -// Support To-Do List -Renderer.prototype.listitem = function(text) { - var result; - - if (/^\s*\[[x ]\]\s*/.test(text)) { - text = text.replace(/^\s*\[ \]\s*/, ' ').replace(/^\s*\[x\]\s*/, ' '); - result = '
  • ' + text + '
  • \n'; - } else { - result = '
  • ' + text + '
  • \n'; - } - - return result; -}; - // Add id attribute to headings Renderer.prototype.heading = function(text, level) { var transformOption = this.options.modifyAnchors; diff --git a/package.json b/package.json index a399e57..cea4b7d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "license": "MIT", "dependencies": { "hexo-util": "^0.6.2", - "marked": "^0.3.9", + "marked": "^0.6.1", "object-assign": "^4.1.1", "strip-indent": "^2.0.0" }, diff --git a/test/index.js b/test/index.js index cce65cf..382a8c6 100644 --- a/test/index.js +++ b/test/index.js @@ -31,7 +31,7 @@ describe('Marked renderer', function() { result.should.eql([ '

    Hello world

    ', - '
    ' + util.highlight(code, {gutter: false, wrap: false}) + '\n
    ', + '
    ' + util.highlight(code, {gutter: false, wrap: false}) + '
    ', '

    Hello world

    ', '

    hello

    ' ].join('') + '\n'); @@ -59,30 +59,6 @@ describe('Marked renderer', function() { result.should.eql('

    中文

    '); }); - it('to-do list testing', function() { - var body = [ - '- [ ] test unchecked', - '- [x] test checked', - '- normal list [x] [ ]', - '', - 'normal text [x] [ ]', - '', - '[x] [ ] normal text' - ].join('\n'); - - var result = r({text: body}); - - result.should.eql([ - '\n', - '

    normal text [x] [ ]

    \n', - '

    [x] [ ] normal text

    \n' - ].join('')); - }); - // Description List tests it('should render description lists with a single space after the colon', function() {