We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e78643a commit 30ec916Copy full SHA for 30ec916
src/paste-markdown-html.ts
@@ -48,15 +48,15 @@ function transform(
48
transformer: MarkdownTransformer,
49
...args: string[]
50
): string {
51
- let markdown = ''
+ const markdownParts = []
52
for (const element of elements) {
53
const textContent = element.textContent || ''
54
const {part, index} = trimAfter(text, textContent)
55
- markdown += part.replace(textContent, transformer(element, args))
+ markdownParts.push(part.replace(textContent, transformer(element, args)))
56
text = text.slice(index)
57
}
58
- markdown += text
59
- return markdown
+ markdownParts.join(text)
+ return markdownParts.join('')
60
61
62
// Trim text at index of last character of the first occurrence of "search" and
0 commit comments