Parcourir la source

处理空字符的问题

lujianhong il y a 4 ans
Parent
commit
9d2ff72155
1 fichiers modifiés avec 17 ajouts et 17 suppressions
  1. 17 17
      EBook.Web/Common/tasklib_book.js

+ 17 - 17
EBook.Web/Common/tasklib_book.js

@@ -277,23 +277,23 @@ function handleAnswerRange() {
     var tempJson = new Array();
 
     //所有underline不做处理
-    //$.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
-    //    tempId = $(item).prevAll(".yaoshi").attr("answer-id");
-    //    //记录上一次的ID
-    //    if (tempId == undefined) {
-    //        tempId = answerId;
-    //    }
-    //    else {
-    //        answerId = tempId;
-    //    }
-    //    var prev = $(item).prev();
-    //    if ((prev.length == 0 || $(prev).attr("class") != "tag-span") && $(prev).attr("class") != "underlineContent") {
-    //        if ($("span[answer-id='" + tempId + "']").length == 0) {
-    //            $(item).prop("outerHTML", "<span answer-id='" + tempId + "' class='tag-span' answer-isky='0'>_</span>");
-    //        }
-    //    }
-    //    $(item).remove();
-    //});
+    $.each($(".yaoshi").nextUntil(".yaoshi").filter(".underline"), function (index, item) {
+        tempId = $(item).prevAll(".yaoshi").attr("answer-id");
+        //记录上一次的ID
+        if (tempId == undefined) {
+            tempId = answerId;
+        }
+        else {
+            answerId = tempId;
+        }
+        var prev = $(item).prev();
+        if ((prev.length == 0 || $(prev).attr("class") != "tag-span") && $(prev).attr("class") != "underlineContent") {
+            if ($("span[answer-id='" + tempId + "']").length == 0) {
+                $(item).prop("outerHTML", "<span answer-id='" + tempId + "' class='tag-span' answer-isky='0'>_</span>");
+            }
+        }
+        $(item).remove();
+    });
 
     //提取参考答案并规范文本格式
     answerId = "";