html-react-parser 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +48 -14
- package/dist/html-react-parser.js +297 -302
- package/dist/html-react-parser.min.js +1 -1
- package/dist/html-react-parser.min.js.map +1 -1
- package/index.d.ts +6 -6
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.9.2](https://github.com/remarkablemark/html-react-parser/compare/v0.9.1...v0.9.2) (2019-11-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* refactor TypeScript declaration file for `index.d.ts` ([f1fc00b](https://github.com/remarkablemark/html-react-parser/commit/f1fc00b))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Build System
|
|
14
|
+
|
|
15
|
+
* **package:** remove `opencollective-postinstall` ([6e0b870](https://github.com/remarkablemark/html-react-parser/commit/6e0b870))
|
|
16
|
+
* **package:** upgrade dependency html-dom-parser@0.2.3 ([891eda4](https://github.com/remarkablemark/html-react-parser/commit/891eda4)), closes [#126](https://github.com/remarkablemark/html-react-parser/issues/126) [remarkablemark/html-dom-parser#18](https://github.com/remarkablemark/html-react-parser/issues/18)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
5
20
|
### [0.9.1](https://github.com/remarkablemark/html-react-parser/compare/v0.9.0...v0.9.1) (2019-07-09)
|
|
6
21
|
|
|
7
22
|
|
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
[](https://coveralls.io/github/remarkablemark/html-react-parser?branch=master)
|
|
8
8
|
[](https://david-dm.org/remarkablemark/html-react-parser)
|
|
9
9
|
[](https://www.npmjs.com/package/html-react-parser)
|
|
10
|
+
[](https://opencollective.com/html-react-parser)
|
|
10
11
|
|
|
11
12
|
HTML to React parser that works on both the server (Node.js) and the client (browser):
|
|
12
13
|
|
|
@@ -159,15 +160,13 @@ const options = {
|
|
|
159
160
|
if (!attribs) return;
|
|
160
161
|
|
|
161
162
|
if (attribs.id === 'main') {
|
|
162
|
-
return (
|
|
163
|
-
<h1 style={{ fontSize: 42 }}>{domToReact(children, parserOptions)}</h1>
|
|
164
|
-
);
|
|
163
|
+
return <h1 style={{ fontSize: 42 }}>{domToReact(children, options)}</h1>;
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
if (attribs.class === 'prettify') {
|
|
168
167
|
return (
|
|
169
168
|
<span style={{ color: 'hotpink' }}>
|
|
170
|
-
{domToReact(children,
|
|
169
|
+
{domToReact(children, options)}
|
|
171
170
|
</span>
|
|
172
171
|
);
|
|
173
172
|
}
|
|
@@ -199,15 +198,19 @@ parse('<p><br id="remove"></p>', {
|
|
|
199
198
|
|
|
200
199
|
#### Is this library XSS safe?
|
|
201
200
|
|
|
202
|
-
No, this library
|
|
201
|
+
No, this library is **_not_** [XSS (Cross-Site Scripting)](https://wikipedia.org/wiki/Cross-site_scripting) safe. See [#94](https://github.com/remarkablemark/html-react-parser/issues/94).
|
|
202
|
+
|
|
203
|
+
#### Does this library sanitize invalid HTML?
|
|
204
|
+
|
|
205
|
+
No, this library does **_not_** perform HTML sanitization. See [#124](https://github.com/remarkablemark/html-react-parser/issues/124).
|
|
203
206
|
|
|
204
207
|
#### Are `<script>` tags parsed?
|
|
205
208
|
|
|
206
|
-
|
|
209
|
+
Although `<script>` tags and their contents are rendered on the server-side, they're not evaluated on the client-side. See [#98](https://github.com/remarkablemark/html-react-parser/issues/98).
|
|
207
210
|
|
|
208
|
-
####
|
|
211
|
+
#### Why aren't my HTML attributes getting called?
|
|
209
212
|
|
|
210
|
-
|
|
213
|
+
This is because [inline event handlers](https://developer.mozilla.org/docs/Web/Guide/Events/Event_handlers) (e.g., `onclick`) are parsed as a _string_ instead of a _function_. See [#73](https://github.com/remarkablemark/html-react-parser/issues/73).
|
|
211
214
|
|
|
212
215
|
## Testing
|
|
213
216
|
|
|
@@ -226,7 +229,6 @@ $ npm run test:coverage
|
|
|
226
229
|
View coverage in browser:
|
|
227
230
|
|
|
228
231
|
```sh
|
|
229
|
-
$ npm run test:coverage
|
|
230
232
|
$ npm run test:coverage:report
|
|
231
233
|
$ open coverage/index.html
|
|
232
234
|
```
|
|
@@ -267,12 +269,44 @@ $ npm run release
|
|
|
267
269
|
$ git push --follow-tags && npm publish
|
|
268
270
|
```
|
|
269
271
|
|
|
270
|
-
##
|
|
272
|
+
## Contributors
|
|
273
|
+
|
|
274
|
+
### Code Contributors
|
|
275
|
+
|
|
276
|
+
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
|
277
|
+
<a href="https://github.com/remarkablemark/html-react-parser/graphs/contributors"><img src="https://opencollective.com/html-react-parser/contributors.svg?width=890&button=false" /></a>
|
|
278
|
+
|
|
279
|
+
### Financial Contributors
|
|
280
|
+
|
|
281
|
+
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/html-react-parser/contribute)]
|
|
282
|
+
|
|
283
|
+
#### Individuals
|
|
284
|
+
|
|
285
|
+
<a href="https://opencollective.com/html-react-parser"><img src="https://opencollective.com/html-react-parser/individuals.svg?width=890"></a>
|
|
286
|
+
|
|
287
|
+
#### Organizations
|
|
288
|
+
|
|
289
|
+
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/html-react-parser/contribute)]
|
|
290
|
+
|
|
291
|
+
<a href="https://opencollective.com/html-react-parser/organization/0/website"><img src="https://opencollective.com/html-react-parser/organization/0/avatar.svg"></a>
|
|
292
|
+
<a href="https://opencollective.com/html-react-parser/organization/1/website"><img src="https://opencollective.com/html-react-parser/organization/1/avatar.svg"></a>
|
|
293
|
+
<a href="https://opencollective.com/html-react-parser/organization/2/website"><img src="https://opencollective.com/html-react-parser/organization/2/avatar.svg"></a>
|
|
294
|
+
<a href="https://opencollective.com/html-react-parser/organization/3/website"><img src="https://opencollective.com/html-react-parser/organization/3/avatar.svg"></a>
|
|
295
|
+
<a href="https://opencollective.com/html-react-parser/organization/4/website"><img src="https://opencollective.com/html-react-parser/organization/4/avatar.svg"></a>
|
|
296
|
+
<a href="https://opencollective.com/html-react-parser/organization/5/website"><img src="https://opencollective.com/html-react-parser/organization/5/avatar.svg"></a>
|
|
297
|
+
<a href="https://opencollective.com/html-react-parser/organization/6/website"><img src="https://opencollective.com/html-react-parser/organization/6/avatar.svg"></a>
|
|
298
|
+
<a href="https://opencollective.com/html-react-parser/organization/7/website"><img src="https://opencollective.com/html-react-parser/organization/7/avatar.svg"></a>
|
|
299
|
+
<a href="https://opencollective.com/html-react-parser/organization/8/website"><img src="https://opencollective.com/html-react-parser/organization/8/avatar.svg"></a>
|
|
300
|
+
<a href="https://opencollective.com/html-react-parser/organization/9/website"><img src="https://opencollective.com/html-react-parser/organization/9/avatar.svg"></a>
|
|
301
|
+
|
|
302
|
+
## Support
|
|
271
303
|
|
|
272
|
-
- [
|
|
273
|
-
- [
|
|
274
|
-
- [
|
|
275
|
-
- [
|
|
304
|
+
- [Patreon](https://b.remarkabl.org/patreon)
|
|
305
|
+
- [Open Collective](https://b.remarkabl.org/open-collective-html-react-parser)
|
|
306
|
+
- [Ko-fi](https://b.remarkabl.org/ko-fi)
|
|
307
|
+
- [Tidelift](https://b.remarkabl.org/tidelift-html-react-parser)
|
|
308
|
+
- [Liberapay](https://b.remarkabl.org/liberapay)
|
|
309
|
+
- [Teepsring](https://b.remarkabl.org/teespring)
|
|
276
310
|
|
|
277
311
|
## License
|
|
278
312
|
|