fix: macros with unquoted parameters failed to take parameters

This commit is contained in:
hugo committed 2026-02-14 22:14:16 +01:00
1 parent c429fb6087
commit 7a1d15d256
3 files changed
+634 -3

No files matched your search

+15
View File
@@ -149,6 +149,21 @@ describe('parseParams', () => {
const result = parseParams('url="https://example.com/path?a=1&b=2"');
expect(result).toEqual({ url: 'https://example.com/path?a=1&b=2' });
});
it('should parse unquoted numeric parameters', () => {
const result = parseParams('year=2016 month=6');
expect(result).toEqual({ year: '2016', month: '6' });
});
it('should parse unquoted alphanumeric parameters', () => {
const result = parseParams('id=abc123 type=photo');
expect(result).toEqual({ id: 'abc123', type: 'photo' });
});
it('should parse mixed quoted and unquoted parameters', () => {
const result = parseParams('year=2016 title="My Photos" month=6');
expect(result).toEqual({ year: '2016', title: 'My Photos', month: '6' });
});
});
describe('parseMacros', () => {