mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
fix(47853): Convert to template string issue (#47976)
This commit is contained in:
@@ -215,7 +215,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
|
||||
const isLastSpan = index === currentNode.templateSpans.length - 1;
|
||||
const text = span.literal.text + (isLastSpan ? subsequentText : "");
|
||||
const rawText = getRawTextOfTemplate(span.literal) + (isLastSpan ? rawSubsequentText : "");
|
||||
return factory.createTemplateSpan(span.expression, isLast
|
||||
return factory.createTemplateSpan(span.expression, isLast && isLastSpan
|
||||
? factory.createTemplateTail(text, rawText)
|
||||
: factory.createTemplateMiddle(text, rawText));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user