preact-markup icon indicating copy to clipboard operation
preact-markup copied to clipboard

Add ability to pass in a custom parser (for server-side-rendering).

Open te-online opened this issue 6 years ago • 1 comments

Potentially fixes #6.

See discussion in https://github.com/developit/preact-markup/pull/18.

This approach adds a parser property, which enables you to use the parser of your choice, when server-side-rendering.

parser – With this property you can pass in a custom parser, such as dom-parser. This enables you to do server-side-rendering.

Example
const parser = typeof document==='undefined' && require('dom-parser');
render(<Markup parser={parser} markup="<em>hello!</em><h1>asdflkj</h1>" />);

What do you think?

te-online avatar Nov 17 '18 15:11 te-online

Follow up: https://github.com/developit/preact-markup/issues/6#issuecomment-809934523

danielweck avatar Mar 30 '21 05:03 danielweck