Skip to content

Commit 16ea4d9

Browse files
committed
Added Installation and usage example into the REAMDE
1 parent 5f197b3 commit 16ea4d9

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
# markdown-it-html-entities
22

33
Currently [markdown-it](https://github.com/markdown-it/markdown-it) follows
4-
[CommonMark specs](https://spec.commonmark.org) which requires HTML Entity
4+
[CommonMark specs](https://spec.commonmark.org) which requires HTML Entities
55
[replacement with Unicode
6-
Character](https://spec.commonmark.org/0.28/#entity-references), though in the
7-
Browsers [HTML
8-
entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) are
9-
displayed using relevant characters.
6+
Characters](https://spec.commonmark.org/0.28/#entity-references) and currently
7+
there is no native way to disable [HTML
8+
Entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) autoconvertion.
109

11-
This plugin is for disabling the HTML Entities to Unicode convertion for
12-
markdown-it.
10+
This plugin disables the automatic HTML Entities to Unicode convertion in
11+
markdown-it and let the browser display expected character using HTML Entities
12+
accordingly, avoiding unexpected character convertion which might not play well
13+
if you would like to integrate the Markdown output with the system that expect
14+
HTML Entities and in general it's just adding support for using HTML Entities in
15+
the Markdown.
16+
17+
## Installation
18+
19+
```bash
20+
npm i markdown-it-html-entities
21+
```
1322

1423
## Usage
1524

1625
```js
17-
```
26+
const markdownIt = require("markdown-it");
27+
const htmlEntities = require("markdown-it-html-entities");
28+
29+
const markdown = markdownIt().use(htmlEntities);
1830

19-
## Example
31+
const result = markdown.render("curly { & } brackets");
32+
console.log(result); // <p>curly &#123; &amp; &#125; brackets</p>
33+
```

0 commit comments

Comments
 (0)