You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ React component for syntax highlighting using highlight.js
6
6
### Installation
7
7
```bash
8
8
npm install react-highlight --save
9
-
```
9
+
```
10
10
11
11
### Usage
12
12
#### Importing component
@@ -22,6 +22,11 @@ Choose the [theme](https://highlightjs.org/static/demo/) for syntax highlighting
22
22
23
23
The styles will most likely be in `node_modules/highlight.js/styles` folder.
24
24
25
+
Props:
26
+
* className: custom class name
27
+
* innerHTML: enable to render markup with dangerouslySetInnerHTML
28
+
*element: render code snippet inside specified element
29
+
25
30
#### Syntax highlighting of single code snippet
26
31
Code snippet that requires syntax highlighting should be passed as children to Highlight component in string format. Language name of code snippet should be specified as className.
27
32
@@ -39,6 +44,6 @@ This is especially usefull if html with multiple code snippets is generated from
0 commit comments