From b4bc8de7b1507acc3d0c825cf70dc84d7717b9ba Mon Sep 17 00:00:00 2001
From: weru <onewesh@gmail.com>
Date: Thu, 12 Nov 2020 02:14:27 +0000
Subject: [PATCH] update
---
assets/js/functions.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/assets/js/functions.js b/assets/js/functions.js
index 5ce18d2..4e8a811 100644
--- a/assets/js/functions.js
+++ b/assets/js/functions.js
@@ -108,14 +108,16 @@
}
function wrapText(text, context, wrapper = 'div') {
- let c = context.innerHTML;
+ let c = context.textContent;
let index = c.indexOf(text);
+ console.log(context);
+ // h1, h2, h3, h4, h5, h6, p, code, a,
if (index >= 0) {
let stop = index + text.length;
let s = c.substring(index,stop);
let before = c.substring(0,index);
let after = c.substring(stop);
c = `${before}<${wrapper}>${s}</${wrapper}>${after}`;
- context.innerHTML = c;
+ context.textContent = c;
}
}
\ No newline at end of file
--
Gitblit v1.10.0