From 43e7e9fe8cfd5abfb8c2fab128c904689469b2ca Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 7 Mar 2018 10:13:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BA=E5=8D=95=E8=A1=8C=E6=8B=86?= =?UTF-8?q?=E8=A7=A3=E6=88=90=E5=A4=9A=E8=A1=8C=E7=BB=93=E6=9E=9C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BC=A9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/tools/translator/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index c09a30a321..dd3b11446f 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -57,7 +57,7 @@ export function normalizeLines(text: string): string { const oneLinePairedTagPattern = /\n( *)<(p|code-example|div|h\d+|a)( ?[^> \n]*)>([^<\n]*)<\/\2>( *)\n/g; text = text.replace(oneLinePairedTagPattern, '\n\n$1<$2$3>$4$5\n\n'); const oneLineThTdTagPattern = /\n( *)<(th|td|li)( ?[^> \n]*)>(.*)<\/\2>( *)/g; - text = text.replace(oneLineThTdTagPattern, '\n\n$1<$2$3>\n\n$1$4\n\n$1$5\n\n'); + text = text.replace(oneLineThTdTagPattern, '\n\n$1<$2$3>\n\n$1 $4\n\n$1$5\n\n'); const oneLineCommentPattern = /\n( *)()( *)\n/g; text = text.replace(oneLineCommentPattern, '\n\n$1$2$3\n\n'); const oneLineBrTagPattern = /\n( *)(
)( *)\n/g; @@ -67,7 +67,7 @@ export function normalizeLines(text: string): string { const oneLineClosedTagPattern = /\n( *)<(hr|p)(\/?)>( *)\n/g; text = text.replace(oneLineClosedTagPattern, '\n\n$1<$2$3>$4\n\n'); const multiLinePairedTagPattern = /\n( *)<(header|p)( *[^> \n]*)>\n*(.*?)\n*( *)<\/\2>( *)\n/g; - text = text.replace(multiLinePairedTagPattern, '\n\n$1<$2$3>\n\n$4\n\n$5$6\n\n'); + text = text.replace(multiLinePairedTagPattern, '\n\n$1<$2$3>\n\n$1 $4\n\n$1$6\n\n'); const blockTagPattern = /\n( *)<(\/?)(td|th|div)( *[^> \n]*)>( *)\n/g; text = text.replace(blockTagPattern, '\n\n$1<$2$3$4>$5\n\n');