hexo-renderer-markdown-it
Advanced tools
Comparing version
@@ -24,2 +24,3 @@ /* global hexo */ | ||
permalinkClass: 'header-anchor', | ||
permalinkSide: 'left', | ||
permalinkSymbol: '¶', | ||
@@ -26,0 +27,0 @@ case: 0, |
@@ -7,3 +7,3 @@ 'use strict'; | ||
const renderPermalink = function(slug, opts, tokens, idx) { | ||
return tokens[idx + 1].children.unshift(Object.assign(new Token('link_open', 'a', 1), { | ||
const permalink = [Object.assign(new Token('link_open', 'a', 1), { | ||
attrs: [['class', opts.permalinkClass], ['href', '#' + slug]] | ||
@@ -14,3 +14,9 @@ }), Object.assign(new Token('text', '', 0), { | ||
content: '' | ||
})); | ||
})]; | ||
if (opts.permalinkSide === 'right') { | ||
return tokens[idx + 1].children.push(...permalink); | ||
} | ||
return tokens[idx + 1].children.unshift(...permalink); | ||
}; | ||
@@ -17,0 +23,0 @@ |
109
package.json
{ | ||
"name": "hexo-renderer-markdown-it", | ||
"version": "4.0.0", | ||
"description": "Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.", | ||
"main": "index.js", | ||
"scripts": { | ||
"eslint": "eslint .", | ||
"test": "mocha test/index.js", | ||
"test-cov": "nyc npm run test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/hexojs/hexo-renderer-markdown-it.git" | ||
}, | ||
"keywords": [ | ||
"hexo", | ||
"renderer", | ||
"markdown", | ||
"markdown-it", | ||
"hexo-renderer" | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib/" | ||
], | ||
"author": "Celso Miranda <contacto@celsomiranda.net> (http://celsomiranda.net/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/hexojs/hexo-renderer-markdown-it/issues" | ||
}, | ||
"homepage": "https://github.com/hexojs/hexo-renderer-markdown-it", | ||
"dependencies": { | ||
"hexo-util": "^1.7.0", | ||
"markdown-it": "^10.0.0", | ||
"markdown-it-abbr": "^1.0.4", | ||
"markdown-it-cjk-breaks": "^1.1.2", | ||
"markdown-it-container": "^2.0.0", | ||
"markdown-it-deflist": "^2.0.3", | ||
"markdown-it-emoji": "^1.4.0", | ||
"markdown-it-footnote": "^3.0.1", | ||
"markdown-it-ins": "^3.0.0", | ||
"markdown-it-mark": "^3.0.0", | ||
"markdown-it-sub": "^1.0.0", | ||
"markdown-it-sup": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-hexo": "^4.0.0", | ||
"mocha": "^6.0.2", | ||
"nyc": "^14.1.1" | ||
}, | ||
"engines": { | ||
"node": ">=8.6.0" | ||
} | ||
"name": "hexo-renderer-markdown-it", | ||
"version": "4.1.0", | ||
"description": "Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.", | ||
"main": "index.js", | ||
"scripts": { | ||
"eslint": "eslint .", | ||
"test": "mocha test/index.js", | ||
"test-cov": "nyc npm run test" | ||
}, | ||
"repository": "hexojs/hexo-renderer-markdown-it", | ||
"keywords": [ | ||
"hexo", | ||
"renderer", | ||
"markdown", | ||
"markdown-it", | ||
"hexo-renderer" | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib/" | ||
], | ||
"author": "Celso Miranda <contacto@celsomiranda.net> (http://celsomiranda.net/)", | ||
"license": "MIT", | ||
"bugs": "https://github.com/hexojs/hexo-renderer-markdown-it/issues", | ||
"homepage": "https://github.com/hexojs/hexo-renderer-markdown-it", | ||
"dependencies": { | ||
"hexo-util": "^1.7.0", | ||
"markdown-it": "^10.0.0", | ||
"markdown-it-abbr": "^1.0.4", | ||
"markdown-it-cjk-breaks": "^1.1.2", | ||
"markdown-it-container": "^2.0.0", | ||
"markdown-it-deflist": "^2.0.3", | ||
"markdown-it-emoji": "^1.4.0", | ||
"markdown-it-footnote": "^3.0.1", | ||
"markdown-it-ins": "^3.0.0", | ||
"markdown-it-mark": "^3.0.0", | ||
"markdown-it-sub": "^1.0.0", | ||
"markdown-it-sup": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-hexo": "^4.0.0", | ||
"mocha": "^6.0.2", | ||
"nyc": "^15.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=8.6.0" | ||
} | ||
} |
@@ -39,4 +39,5 @@ # hexo-renderer-markdown-it | ||
collisionSuffix: '' | ||
permalink: false, | ||
permalink: false | ||
permalinkClass: 'header-anchor' | ||
permalinkSide: 'left' | ||
permalinkSymbol: '¶' | ||
@@ -43,0 +44,0 @@ case: 0 |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8116
0.41%100
5.26%58
1.75%0
-100%1
Infinity%3
50%