Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update marked to ^0.7.0 #102

Merged
merged 3 commits into from Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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