Skip to content

Commit

Permalink
release: v6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Dec 31, 2024
1 parent 7e5dde1 commit 9b525a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hexo-renderer-marked

[![Build Status](https://github.com/hexojs/hexo-renderer-marked/workflows/Tester/badge.svg?branch=master)](https://github.com/hexojs/hexo-renderer-marked/actions?query=workflow%3ATester)
[![Build Status](https://img.shields.io/github/actions/workflow/status/hexojs/hexo-renderer-marked/tester.yml?logo=github&label=tester)](https://github.com/hexojs/hexo-renderer-marked/actions?query=workflow%3ATester)
[![NPM version](https://badge.fury.io/js/hexo-renderer-marked.svg)](https://www.npmjs.com/package/hexo-renderer-marked)
[![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-renderer-marked.svg)](https://coveralls.io/r/hexojs/hexo-renderer-marked?branch=master)
[![NPM Dependencies](https://img.shields.io/librariesio/release/npm/hexo-renderer-marked.svg)](https://libraries.io/npm/hexo-renderer-marked)
Expand All @@ -20,7 +20,7 @@ There are two solutions to avoid those issues:

## Installation

``` bash
```bash
$ npm install hexo-renderer-marked --save
```

Expand All @@ -32,7 +32,7 @@ $ npm install hexo-renderer-marked --save

You can configure this plugin in `_config.yml`.

``` yaml
```yml
marked:
gfm: true
pedantic: false
Expand Down Expand Up @@ -83,7 +83,7 @@ marked:
- **figcaption** - Append `figcaption` element after each image.
- **prependRoot** - Prepend root value to (internal) image path.
* Example `_config.yml`:
``` yml
```yml
root: /blog/
```
* `![text](/path/to/image.jpg)` becomes `<img src="/blog/path/to/image.jpg" alt="text">`
Expand Down Expand Up @@ -112,7 +112,7 @@ For more options, see [Marked](https://marked.js.org/using_advanced#options). Du

To enable it, pass an object containing the DOMPurify options:

```json
```yml
dompurify: true
```

Expand Down Expand Up @@ -173,7 +173,7 @@ This plugin overrides some default behaviours of how [marked] plugin renders the

For example, to override how heading like `# heading text` is rendered:

``` js
```js
hexo.extend.filter.register('marked:renderer', function(renderer) {
const { config } = this; // Skip this line if you don't need user config from _config.yml
renderer.heading = function(text, level) {
Expand All @@ -196,7 +196,7 @@ Notice `renderer.heading = function (text, level) {` corresponds to [this line](

It is also possible to customize the [tokenizer](https://marked.js.org/using_pro#tokenizer).

``` js
```js
const { escapeHTML: escape } = require('hexo-util');

// https://github.com/markedjs/marked/blob/b6773fca412c339e0cedd56b63f9fa1583cfd372/src/Lexer.js#L8-L24
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-renderer-marked",
"version": "6.3.0",
"version": "6.4.0",
"description": "Markdown renderer plugin for Hexo",
"main": "index",
"scripts": {
Expand Down

0 comments on commit 9b525a6

Please sign in to comment.