From eaaa5f632e0d881a00a60cadd114be899a12a25c Mon Sep 17 00:00:00 2001 From: Chung Leong Date: Mon, 28 Jan 2019 11:51:09 +0100 Subject: [PATCH] Added fixed for errant < (issue #27). --- server/index.js | 3 +++ src/widgets/html.jsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/server/index.js b/server/index.js index 8dc0ef3..973ad10 100644 --- a/server/index.js +++ b/server/index.js @@ -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); diff --git a/src/widgets/html.jsx b/src/widgets/html.jsx index 063159d..2b28429 100644 --- a/src/widgets/html.jsx +++ b/src/widgets/html.jsx @@ -5,6 +5,8 @@ class HTML extends PureComponent { render() { let { text, transform } = this.props; let options = { transform }; + // fix unescaped < + text = text.replace(/<([^>]*)