Skip to content

Commit

Permalink
Merge pull request markedjs#1417 from mido-app/update-doc-about-exten…
Browse files Browse the repository at this point in the history
…ding-renderer

Update documentation about extending Renderer
  • Loading branch information
styfle committed Feb 13, 2019
2 parents 99d47d9 + 8fd5d37 commit 18cd94a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/USING_PRO.md
Expand Up @@ -45,18 +45,30 @@ console.log(myMarked('# heading+', { renderer: renderer }));

### Block level renderer methods

- code(*string* code, *string* language, *boolean* escaped)
- code(*string* code, *string* infostring, *boolean* escaped)
- blockquote(*string* quote)
- html(*string* html)
- heading(*string* text, *number* level, *string* rawtext)
- heading(*string* text, *number* level, *string* raw, *Slugger* slugger)
- hr()
- list(*string* body, *boolean* ordered, *number* start)
- listitem(*string* text)
- checkbox(*boolean* checked)
- paragraph(*string* text)
- table(*string* header, *string* body)
- tablerow(*string* content)
- tablecell(*string* content, *object* flags)

`slugger` has the `slug` method to create an unique id from value:

```js
slugger.slug('foo') // foo
slugger.slug('foo') // foo-1
slugger.slug('foo') // foo-2
slugger.slug('foo 1') // foo-1-1
slugger.slug('foo-1') // foo-1-2
...
```

`flags` has the following properties:

```js
Expand Down

0 comments on commit 18cd94a

Please sign in to comment.