From b2b8223f5f4ad2204441f4f189a8050f11321263 Mon Sep 17 00:00:00 2001 From: mRNA <1518926653@qq.com> Date: Fri, 15 Nov 2024 17:24:52 +0800 Subject: [PATCH] change the injector judge --- lib/extend/injector.ts | 9 +-------- test/scripts/extend/injector.ts | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/extend/injector.ts b/lib/extend/injector.ts index 0f341f519b..06485e829c 100644 --- a/lib/extend/injector.ts +++ b/lib/extend/injector.ts @@ -66,14 +66,7 @@ class Injector { } _injector(input: string, pattern: string | RegExp, flag: Entry, isBegin = true, currentType: string): string { - if ( - (flag==='head_begin' && /\s*/.test(input)) || - (flag==='body_begin' && /\s*/.test(input)) || - (flag==='head_end' && /\s*<\/head>/.test(input)) || - (flag==='body_end' && /\s*<\/body>/.test(input)) - ) { - return input; - } + if (input.includes(`'); result.should.contain(''); }); + it('exec() - multi-line head & body', () => { const content = [