From 186e66ca75f3cd1d602581adc3f0d1bf301d1949 Mon Sep 17 00:00:00 2001 From: TooBug Date: Sat, 22 Nov 2014 13:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8F=92=E5=85=A5=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E5=87=BA=E7=8E=B0undefined=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 双击某个地方选中一个单词,点击code,会出现undefined字样。不确定是否是意料中的行为,或者也有可能是前面没处理好导致undefined出现 --- src/pen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pen.js b/src/pen.js index dd4735d..1c8d621 100644 --- a/src/pen.js +++ b/src/pen.js @@ -135,7 +135,7 @@ } function commandWrap(ctx, tag, value) { - value = '<' + tag + '>' + value + ''; + value = '<' + tag + '>' + (value||'') + ''; return commandOverall(ctx, 'insertHTML', value); }