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