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 d99e3b6 commit fa45aa8Copy full SHA for fa45aa8
src/runtime/utils/node.ts
@@ -1,4 +1,4 @@
1
-import type { VNode } from 'vue'
+import { Comment, type VNode } from 'vue'
2
import type { MDCElement, MDCNode, MDCText } from '../types'
3
4
/**
@@ -117,7 +117,7 @@ function _flatUnwrap (vnodes: VNode | VNode[], tags = ['p']): Array<VNode> {
117
export function flatUnwrap (vnodes: VNode | VNode[], tags = ['p']): Array<VNode | string> {
118
return _flatUnwrap(vnodes, tags)
119
.reduce((acc, item) => {
120
- if (typeof item.children === 'string') {
+ if (typeof item.children === 'string' && item.type !== Comment) {
121
if (typeof acc[acc.length - 1] === 'string') {
122
acc[acc.length - 1] += item.children
123
} else {
0 commit comments