hexo-renderer-mark
Advanced tools
Comparing version 0.1.0 to 0.1.1
31
index.js
@@ -6,2 +6,15 @@ "use strict"; | ||
var renderer = new marked.Renderer(); | ||
renderer.heading = function (text, level) { | ||
var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); | ||
return '<h' + level + '><a name="' + | ||
escapedText + | ||
'" class="anchor" href="#' + | ||
escapedText + | ||
'"><span class="header-link"></span></a>' + | ||
text + '</h' + level + '>'; | ||
}; | ||
var config = Object.assign({}, hexo.config.mark); | ||
@@ -23,12 +36,12 @@ | ||
function renderer(data, options) { | ||
return marked(data.text); | ||
function _renderer(data, options) { | ||
return marked(data.text, { renderer: renderer }); | ||
} | ||
hexo.extend.renderer.register('md', 'html', renderer, true); | ||
hexo.extend.renderer.register('markdown', 'html', renderer, true); | ||
hexo.extend.renderer.register('mkd', 'html', renderer, true); | ||
hexo.extend.renderer.register('mkdn', 'html', renderer, true); | ||
hexo.extend.renderer.register('mdwn', 'html', renderer, true); | ||
hexo.extend.renderer.register('mdtxt', 'html', renderer, true); | ||
hexo.extend.renderer.register('mdtext', 'html', renderer, true); | ||
hexo.extend.renderer.register('md', 'html', _renderer, true); | ||
hexo.extend.renderer.register('markdown', 'html', _renderer, true); | ||
hexo.extend.renderer.register('mkd', 'html', _renderer, true); | ||
hexo.extend.renderer.register('mkdn', 'html', _renderer, true); | ||
hexo.extend.renderer.register('mdwn', 'html', _renderer, true); | ||
hexo.extend.renderer.register('mdtxt', 'html', _renderer, true); | ||
hexo.extend.renderer.register('mdtext', 'html', _renderer, true); |
{ | ||
"name": "hexo-renderer-mark", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "hexo plugin to renderer markdown file", | ||
@@ -12,3 +12,2 @@ "main": "index.js", | ||
"dependencies": { | ||
"hexo-util": "^0.6.0", | ||
"highlight.js": "^9.5.0", | ||
@@ -15,0 +14,0 @@ "marked": "^0.3.5" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1931
2
37
- Removedhexo-util@^0.6.0
- Removedbluebird@3.7.2(transitive)
- Removedcamel-case@3.0.0(transitive)
- Removedcross-spawn@4.0.2(transitive)
- Removedhexo-util@0.6.3(transitive)
- Removedhtml-entities@1.4.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedlower-case@1.1.4(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedno-case@2.3.2(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedstriptags@2.2.1(transitive)
- Removedupper-case@1.1.3(transitive)
- Removedwhich@1.3.1(transitive)
- Removedyallist@2.1.2(transitive)