Skip to content

Commit

Permalink
docs(renderer): remove link to oudated line
Browse files Browse the repository at this point in the history
incorrect after marked v15 update #305
  • Loading branch information
curbengh committed Jan 19, 2025
1 parent 9d42f9e commit 1a504f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ For example, to override how heading like `# heading text` is rendered:

```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
const { config } = this; // Optional if you don't need user config from _config.yml
renderer.heading = function({ tokens, depth: level }) {
const text = this.parser.parseInline(tokens);
// Default behaviour
Expand All @@ -191,7 +191,7 @@ hexo.extend.filter.register('marked:renderer', function(renderer) {

Save the file in "scripts/" folder and run Hexo as usual.

Notice `renderer.heading = function (text, level) {` corresponds to [this line](https://github.com/hexojs/hexo-renderer-marked/blob/a93ebeb1e8cc11e754630c0a1506da9a1489b2b0/lib/renderer.js#L21). Refer to [renderer.js](https://github.com/hexojs/hexo-renderer-marked/blob/master/lib/renderer.js) on how this plugin overrides the default methods. For other methods not covered by this plugin, refer to marked's [documentation](https://marked.js.org/using_pro#renderer).
Refer to [renderer.js](https://github.com/hexojs/hexo-renderer-marked/blob/master/lib/renderer.js) on how this plugin overrides the default methods. For other methods not covered by this plugin, refer to marked's [documentation](https://marked.js.org/using_pro#renderer).

#### Tokenizer

Expand Down

0 comments on commit 1a504f1

Please sign in to comment.