From bbe4afecf6a56f4bdaaafe083a3bf67191fd9cde Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 6 Apr 2017 21:07:55 -0700 Subject: wip --- ext/fg/js/util.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ext/fg') diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index a1bce660..59060221 100644 --- a/ext/fg/js/util.js +++ b/ext/fg/js/util.js @@ -205,14 +205,10 @@ function docClozeExtract(source, extent) { } const sentence = content.substring(startPos, endPos); - const clozePrefix = sentence.substring(0, position - startPos); - const clozeBody = source.text(); - const clozeSuffix = sentence.substring(position - startPos + clozeBody.length); + const padding = sentence.length - sentence.replace(/^\s+/, ''); return { sentence: sentence.trim(), - prefix: clozePrefix.trim(), - body: clozeBody.trim(), - suffix: clozeSuffix.trim() + offset: position - startPos - padding }; } -- cgit v1.2.3