8000 chore(package): update marked 0.3.9 to 0.6.1 (#87) · hexojs/hexo-renderer-marked@8ec59ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ec59ff

Browse files
committed
chore(package): update marked 0.3.9 to 0.6.1 (#87)
* marked 0.4.0 is Compliant with GFM task list * markedjs/marked#1250 * fix: Remove extra inner linebreak from code blocks * markedjs/marked#1266 * refactor: drop self implemented todo listitem * GFM list is implemented in marked 0.4.0
1 parent 88d39fb commit 8ec59ff

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

lib/renderer.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ function Renderer() {
1717

1818
require('util').inherits(Renderer, MarkedRenderer);
1919

20-
// Support To-Do List
21-
Renderer.prototype.listitem = function(text) {
22-
var result;
23-
24-
if (/^\s*\[[x ]\]\s*/.test(text)) {
25-
text = text.replace(/^\s*\[ \]\s*/, '<input type="checkbox"></input> ').replace(/^\s*\[x\]\s*/, '<input type="checkbox" checked></input> ');
26-
result = '<li style="list-style: none">' + text + '</li>\n';
27-
} else {
28-
result = '<li>' + text + '</li>\n';
29-
}
30-
31-
return result;
32-
};
33-
3420
// Add id attribute to headings
3521
Renderer.prototype.heading = function(text, level) {
3622
var transformOption = this.options.modifyAnchors;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"license": "MIT",
2626
"dependencies": {
2727
"hexo-util": "^0.6.2",
28-
"marked": "^0.3.9",
28+
"marked": "^0.6.1",
2929
"object-assign": "^4.1.1",
3030
"strip-indent": "^2.0.0"
3131
},

test/index.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('Marked renderer', function() {
3131

3232
result.should.eql([
3333
'<h1 id="Hello-world"><a href="#Hello-world" class="headerlink" title="Hello world"></a>Hello world</h1>',
34-
'<pre><code>' + util.highlight(code, {gutter: false, wrap: false}) + '\n</code></pre>',
34+
'<pre><code>' + util.highlight(code, {gutter: false, wrap: false}) + '</code></pre>',
3535
'<h2 id="Hello-world-1"><a href="#Hello-world-1" class="headerlink" title="Hello world"></a>Hello world</h2>',
3636
'<p>hello</p>'
3737
].join('') + '\n');
@@ -59,30 +59,6 @@ describe('Marked renderer', function() {
5959
result.should.eql('<h1 id="中文"><a href="#中文" class="headerlink" title="中文"></a>中文</h1>');
6060
});
6161

62-
it('to-do list testing', function() {
63-
var body = [
64-
'- [ ] test unchecked',
65-
'- [x] test checked',
66-
'- normal list [x] [ ]',
67-
'',
68-
'normal text [x] [ ]',
69-
'',
70-
'[x] [ ] normal text'
71-
].join('\n');
72-
73-
var result = r({text: body});
74-
75-
result.should.eql([
76-
'<ul>\n',
77-
'<li style="list-style: none"><input type="checkbox"></input> test unchecked</li>\n',
78-
'<li style="list-style: none"><input type="checkbox" checked></input> test checked</li>\n',
79-
'<li>normal list [x] [ ]</li>\n',
80-
'</ul>\n',
81-
'<p>normal text [x] [ ]</p>\n',
82-
'<p>[x] [ ] normal text</p>\n'
83-
].join(''));
84-
});
85-
8662
// Description List tests
8763

8864
it('should render description lists with a single space after the colon', function() {

0 commit comments

Comments
 (0)
0