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');