docs(API): 改进标题行翻译方式

docs(API): 翻译了 directive.ts 中的所有 tsdoc
This commit is contained in:
Zhicheng Wang
2018-08-31 09:01:12 +08:00
parent fcfe9c581d
commit 2cd125f40c
6 changed files with 866 additions and 277 deletions
@@ -12,7 +12,7 @@ module.exports = function splitDescription() {
docs.forEach(doc => {
if (this.docTypes.indexOf(doc.docType) !== -1 && doc.description !== undefined) {
const description = doc.description.trim();
const endOfParagraph = description.search(/\n\s*\n/);
const endOfParagraph = description.search(/\n\s*\n+(?!.*[\u4e00-\u9fa5])/); // 从第一个非汉字行开始拆分
if (endOfParagraph === -1) {
doc.shortDescription = description;
doc.description = '';