浏览代码

fix numeric presence condition

Hakim El Hattab 6 年之前
父节点
当前提交
32197bd77d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugin/highlight/highlight.js

+ 1 - 1
plugin/highlight/highlight.js

@@ -141,7 +141,7 @@ c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});
 						block.parentNode.appendChild( fragmentBlock );
 						RevealHighlight.highlightLines( fragmentBlock );
 
-						if( fragmentIndex ) {
+						if( typeof fragmentIndex === 'number' ) {
 							fragmentBlock.setAttribute( 'data-fragment-index', fragmentIndex );
 							fragmentIndex += 1;
 						}