Skip to content

Commit

Permalink
remark-parse: improve turning off a tokenizer
Browse files Browse the repository at this point in the history
Closes GH-360.

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
bjudson authored and wooorm committed Oct 3, 2018
1 parent ddc948a commit 9c5e2ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/remark-parse/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,18 @@ The given `node`.
### Turning off a tokenizer

In rare situations, you may want to turn off a tokenizer to avoid parsing
that syntactic feature. This can be done by deleting the tokenizer from
that syntactic feature. This can be done by replacing the tokenizer from
your Parser’s `blockTokenizers` (or `blockMethods`) or `inlineTokenizers`
(or `inlineMethods`).

The following example turns off indented code blocks:

```js
delete remarkParse.Parser.prototype.blockTokenizers.indentedCode;
remarkParse.Parser.prototype.blockTokenizers.indentedCode = function () { return true };
```

Preferably, just use [this plugin](https://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-disable-tokenizers).

## License

[MIT][license] © [Titus Wormer][author]
Expand Down

0 comments on commit 9c5e2ed

Please sign in to comment.