disable addSpacing, it has bugs:

1. make sub li click event buggy
2. taged chinese has space too.
This commit is contained in:
rexebin 2016-11-24 22:00:50 +00:00
parent 754e11dc13
commit dedeb6e8ac
2 changed files with 15 additions and 15 deletions

View File

@ -253,7 +253,7 @@ block create-your-app
:marked :marked
**Create #{_an} #{_appDir} subfolder** off the project root directory: **Create #{_an} #{_appDir} subfolder** off the project root directory:
**在应用的根目录下创建#{_appDir}子目录: 在应用的根目录下**创建#{_appDir}子目录**
code-example.code-shell. code-example.code-shell.
mkdir #{_appDir} mkdir #{_appDir}

View File

@ -101,7 +101,7 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true';
event.stopPropagation(); event.stopPropagation();
$current.toggleClass('hidden'); $current.toggleClass('hidden');
}); });
addSpacingBetweenCnAndEn(sibling); // addSpacingBetweenCnAndEn(sibling);
return true; return true;
} }
} }
@ -138,17 +138,17 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true';
attributesToString(node1) === attributesToString(node2); attributesToString(node1) === attributesToString(node2);
} }
function addSpacingBetweenCnAndEn(nodeCn) { // function addSpacingBetweenCnAndEn(nodeCn) {
var text = nodeCn.innerHTML; // var text = nodeCn.innerHTML;
text = text.replace(/([\x20-\xff]+)/g, function (word) { // text = text.replace(/([\x20-\xff]+)/g, function (word) {
if (!word.replace(/\s/, '')) { // if (!word.replace(/\s/, '')) {
return ''; // return '';
} else if (/<[^>]*>/.test(word)) { // } else if (/<[^>]*>/.test(word)) {
return ' ' + word + ' '; // return ' ' + word + ' ';
} else { // } else {
return ' ' + word + ' '; // return ' ' + word + ' ';
} // }
}); // });
nodeCn.innerHTML = text; // nodeCn.innerHTML = text;
} // }
})(angular.element); })(angular.element);