fix bug 545
							parent
							
								
									5ad6ba07cf
								
							
						
					
					
						commit
						0b5dacb472
					
				|  | @ -34,10 +34,10 @@ function highLight() { | |||
|     } | ||||
|     const list = allWords.split(" ");//将所有的生词放入一个list中,用于后续处理
 | ||||
|     //判断获取的单词不能为空
 | ||||
|     if(word !== null && word !== "" && word !== " "){ | ||||
|     if(word != null && word != "" && word != " "){ | ||||
|         let articleContent_fb2 = articleContent; | ||||
|         if(localStorage.getItem("nowWord").indexOf(word) !== -1){ | ||||
|             while(articleContent_fb2.toLowerCase().indexOf(word.toLowerCase()) !== -1){ | ||||
|         if(localStorage.getItem("nowWord").indexOf(word) != -1){ | ||||
|             while(articleContent_fb2.toLowerCase().indexOf(word.toLowerCase()) != -1){ | ||||
|                 // 找到副本中和list[i]匹配的第一个单词(第一种匹配情况),并赋值给list[i]。
 | ||||
|                 const index = articleContent_fb2.toLowerCase().indexOf(word.toLowerCase()); | ||||
|                 word = articleContent_fb2.substring(index, index + word.length); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue