mirror of
https://github.com/trambarhq/relaks-wordpress-example.git
synced 2025-09-02 12:42:38 +02:00
Added fixed for errant < (issue #27).
This commit is contained in:
@@ -51,6 +51,9 @@ async function handleJSONRequest(req, res, next) {
|
||||
try {
|
||||
let path = `/wp-json/${req.url.substr(6)}`;
|
||||
let json = await JSONRetriever.fetch(path);
|
||||
if (json.total) {
|
||||
res.set({ 'X-WP-Total': json.total });
|
||||
}
|
||||
res.send(json.text);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
|
@@ -5,6 +5,8 @@ class HTML extends PureComponent {
|
||||
render() {
|
||||
let { text, transform } = this.props;
|
||||
let options = { transform };
|
||||
// fix unescaped <
|
||||
text = text.replace(/<([^>]*)</g, '<$1<');
|
||||
return ReactHtmlParser(text, options);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user