preact-markup
preact-markup copied to clipboard
Add ability to pass in a custom parser (for server-side-rendering).
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 asdom-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?
Follow up: https://github.com/developit/preact-markup/issues/6#issuecomment-809934523