Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/nuxt/src/pages/macros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const starts = {
"'": "'"
}

const quotes = ['"', "'"]

function extractObject (code: string) {
// Strip comments
code = code.replace(/^\s*\/\/.*$/gm, '')
Expand All @@ -107,7 +109,7 @@ function extractObject (code: string) {
do {
if (stack[0] === code[0] && result.slice(-1) !== '\\') {
stack.shift()
} else if (code[0] in starts) {
} else if (code[0] in starts && !quotes.includes(stack[0])) {
Comment thread
danielroe marked this conversation as resolved.
Outdated
stack.unshift(starts[code[0]])
}
result += code[0]
Expand Down