From abb10f112aa1248700e98caa0273f6afc5154a47 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 22 Jun 2024 20:07:43 -0400 Subject: Yes we are 2.6 now. --- generator/util.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'generator/util.js') diff --git a/generator/util.js b/generator/util.js index e9b5c78..85e7ab3 100644 --- a/generator/util.js +++ b/generator/util.js @@ -1,7 +1,8 @@ //Copyright Chris Xiong 2019 //License: Expat (MIT) module.exports={ - mtime_cmp:function(a,b){return _mtime_cmp(a,b);} + mtime_cmp: function(a, b){ return _mtime_cmp(a, b); }, + htmlescape: function(s){ return _htmlescape(s); } }; const fs=require('fs'); @@ -17,3 +18,11 @@ function _mtime_cmp(a,b) }catch(e){return false}; return mtimeb>=mtimea; } +function _htmlescape(s) +{ + return s.replace(//g, ">") + .replace(/&/g, "&") + .replace(/"/g, """) + .replace(/'/g, "'"); +} -- cgit v1.2.3