From 957c283d8a694567d3f2dc9033a4edd7988dd09b Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 9 Apr 2017 11:36:52 -0700 Subject: [PATCH] fix #44, fix #45 --- ext/mixed/js/display.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 64d462ae..0167c605 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -74,7 +74,10 @@ class Display { if (context) { for (const definition of definitions) { - definition.cloze = clozeBuild(context.sentence, definition.source); + if (context.sentence) { + definition.cloze = clozeBuild(context.sentence, definition.source); + } + definition.url = context.url; } } @@ -108,7 +111,10 @@ class Display { if (context) { for (const definition of definitions) { - definition.cloze = clozeBuild(context.sentence); + if (context.sentence) { + definition.cloze = clozeBuild(context.sentence); + } + definition.url = context.url; } }