Skip to content

Commit 12724d0

Browse files
committed
Fix cleanErrorMessage regex (not is not guaranteed to come last)
1 parent d637ad1 commit 12724d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/theme-check-common/src/checks/liquid-html-syntax-error

packages/theme-check-common/src/checks/liquid-html-syntax-error/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function isParsingErrorWithLocation(
2525
function cleanErrorMessage(message: string, highlight: string): string {
2626
return message
2727
.replace(/Line \d+, col \d+:\s+/, 'SyntaxError: ')
28-
.replace(/(?!<expected ".+",) not .*/, ` not "${highlight}"`);
28+
.replace(/ not (?:\(.*?\)|.*?)(?=, | or |$)/, ` not "${highlight}"`);
2929
}
3030

3131
export const LiquidHTMLSyntaxError: LiquidCheckDefinition = {

0 commit comments

Comments
 (0)