From d0b02d53a592a25643eec9e3b31ae11d248d4227 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sun, 24 Jun 2018 11:45:59 -0700 Subject: [PATCH] Reuse escapeHtml --- lib/util.js | 2 +- pages/index.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/util.js b/lib/util.js index 1986bae..bb2696c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -12,7 +12,7 @@ const parse = v => { } } -const escapeHtml = s => { +export const escapeHtml = s => { if (typeof s === 'string') { return s .replace(/= 0 ? str.substr(0, qI) : str) - .replace(//g, '>') - .replace(/\//g, '/') + return escapeHtml(qI >= 0 ? str.substr(0, qI) : str) } export default Index