diff --git a/aio/tools/translator/utils.spec.ts b/aio/tools/translator/utils.spec.ts index 2c057336a8..8b212c1f10 100644 --- a/aio/tools/translator/utils.spec.ts +++ b/aio/tools/translator/utils.spec.ts @@ -286,7 +286,11 @@ ng generate directive highlight `)).eql(` - abc + + + abc + + `); diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index 64e1018197..6a5da487f3 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -68,6 +68,9 @@ export function normalizeLines(text: string): string { const trTagPattern = /( *)(\n]*>)(.*)(<\/tr>)/g; text = text.replace(trTagPattern, '\n\n$1$2\n\n$1 $3\n\n$1$4\n\n'); + const thTdTagPattern = /( *)<(th|td)\b( *[^>\n]*)>(.*?)<\/\2>/g; + text = text.replace(thTdTagPattern, '\n\n$1<$2$3>\n\n$1 $4\n\n$1\n\n'); + const blockTagPattern = /\n( *)<(\/?)(td|th|div|code-example|code-tabs|h\d+|p|tr)\b( *[^>\n]*)>( *)(?=\n)/g; text = text.replace(blockTagPattern, '\n\n$1<$2$3$4>$5\n');