diff --git a/src/lib/css_class_helpers.test.ts b/src/lib/css_class_helpers.test.ts index ab99ff0c..07043efd 100644 --- a/src/lib/css_class_helpers.test.ts +++ b/src/lib/css_class_helpers.test.ts @@ -136,8 +136,8 @@ const values: Array<[contents: string, expected: string[]]> = [ ["classes = ['a'", []], ['classes = ["a",,"b",,,"c",]', ['a', 'b', 'c']], // nested arrays - ['classes = [["a", "b"], "c", ["d"]]', ['c']], // TODO BLOCK FAILING - ['classes = ["a", ["b", "c"], "d"]', ['a', 'd']], // TODO BLOCK FAILING + ['classes = [["a", "b"], "c", ["d"]]', []], // TODO @many ideally fix instead of bailing, but maybe we need a real JS parser? + ['classes = ["a", ["b", "c"], "d"]', []], // TODO @many ideally fix instead of bailing, but maybe we need a real JS parser? // arrays in component prop ['', ['a', 'b', 'c']], ['', ['a', 'b', 'c']], diff --git a/src/lib/css_class_helpers.ts b/src/lib/css_class_helpers.ts index 57e0a132..d997c095 100644 --- a/src/lib/css_class_helpers.ts +++ b/src/lib/css_class_helpers.ts @@ -39,6 +39,7 @@ const CSS_CLASS_EXTRACTORS: Css_Extractor[] = [ matcher: /(? { const content = matched[1]; + if (content.includes('[')) return []; // TODO @many ideally fix instead of bailing, but maybe we need a real JS parser? const items = content.split(',').map((item) => item.trim()); return items