diff --git a/aio/tools/translator/utils.spec.ts b/aio/tools/translator/utils.spec.ts index 232c428578..fce9fe0cc3 100644 --- a/aio/tools/translator/utils.spec.ts +++ b/aio/tools/translator/utils.spec.ts @@ -217,42 +217,36 @@ ng generate directive highlight it('拆解多行的成对 tag', function () { const lines = normalizeLines(` -
- Angular forms don't require a style library -
+

+ a +

+ +

+ 一 +

+ `); expect(lines).eq(` -
+

- Angular forms don't require a style library + a -

+

+ +

+ + 一 + +

`); }); - it('拆解多行的成对 tag', function () { + it('不要拆解 header', function () { const lines = normalizeLines(` -

- a -

- -

- 一 -

- +
Angular forms don't require a style library
`); expect(lines).eq(` -

- - a - -

- -

- - 一 - -

+
Angular forms don't require a style library
`); }); diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index 05afae62b0..ba67cd8d70 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -78,8 +78,6 @@ export function normalizeLines(text: string): string { text = text.replace(atTagCommentPattern, '\n\n$1$2$3\n'); const oneLineClosedTagPattern = /\n( *)<(hr)(\/?)>( *)(?=\n)/g; text = text.replace(oneLineClosedTagPattern, '\n\n$1<$2$3>$4\n'); - const multiLinePairedTagPattern = /\n( *)<(header)( *[^>\n]*)>\n*(.*?)\n*( *)<\/\2>( *)(?=\n)/g; - text = text.replace(multiLinePairedTagPattern, '\n\n$1<$2$3>\n\n$4\n\n$5$6\n'); const trTagPattern = /( *)(\n]*>)(.*)(<\/tr>)/g; text = text.replace(trTagPattern, '\n\n$1$2\n\n$1 $3\n\n$1$4\n\n');