Skip to content

Commit

Permalink
chore(deps): update marked to ^0.7.0 (#102)
Browse files Browse the repository at this point in the history
* chore(deps): update marked to ^0.7.0

* refactor: remove unused 'sanitize' option

* feat: restore plugin sanitize function, rename to sanitizeUrl
  • Loading branch information
curbengh authored and tomap committed Aug 2, 2019
1 parent 8ccc1df commit 483d99d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions README.md
Expand Up @@ -23,24 +23,22 @@ You can configure this plugin in `_config.yml`.
marked:
gfm: true
pedantic: false
sanitize: false
tables: true
breaks: true
smartLists: true
smartypants: true
modifyAnchors: ''
autolink: true
sanitizeUrl: false
```

- **gfm** - Enables [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown)
- **pedantic** - Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of the original markdown bugs or poor behavior.
- **sanitize** - Sanitize the output. Ignore any HTML that has been input.
- **tables** - Enable GFM [tables](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables). This option requires the `gfm` option to be true.
- **breaks** - Enable GFM [line breaks](https://help.github.com/articles/github-flavored-markdown#newlines). This option requires the `gfm` option to be true.
- **smartLists** - Use smarter list behavior than the original markdown.
- **smartypants** - Use "smart" typograhic punctuation for things like quotes and dashes.
- **modifyAnchors** - Use for transform anchorIds. if `1` to lowerCase and if `2` to upperCase. **Must be integer**.
- **autolink** - Enable autolink for URLs. E.g. `https://hexo.io` will become `<a href="https://hexo.io">https://hexo.io</a>`.
- **sanitizeUrl** - Remove URLs that start with `javascript:`, `vbscript:` and `data:`.

## Extras

Expand Down
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -7,13 +7,12 @@ var renderer = require('./lib/renderer');
hexo.config.marked = Object.assign({
gfm: true,
pedantic: false,
sanitize: false,
tables: true,
breaks: true,
smartLists: true,
smartypants: true,
modifyAnchors: '',
autolink: true
autolink: true,
sanitizeUrl: false
}, hexo.config.marked);

hexo.extend.renderer.register('md', 'html', renderer, true);
Expand Down
2 changes: 1 addition & 1 deletion lib/renderer.js
Expand Up @@ -35,7 +35,7 @@ function anchorId(str, transformOption) {

// Support AutoLink option
Renderer.prototype.link = function(href, title, text) {
if (this.options.sanitize) {
if (this.options.sanitizeUrl) {
let prot;

try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"license": "MIT",
"dependencies": {
"hexo-util": "^0.6.3",
"marked": "^0.6.2",
"marked": "^0.7.0",
"strip-indent": "^3.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 483d99d

Please sign in to comment.