refactor(theme): split admonitions, make swizzle easier, better retrocompatibility (#7945)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
Sébastien Lorber 2022-09-07 17:49:44 +02:00 committed by GitHub
parent f1415525c0
commit 6f63ffe0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 914 additions and 236 deletions

View file

@ -96,13 +96,20 @@ describe('validation schemas', () => {
testOK({});
testOK({tag: '+++'});
testOK({keywords: ['info', 'tip']});
testOK({keywords: ['info', 'tip'], extendDefaults: true});
testOK({keywords: ['info', 'tip'], extendDefaults: false});
testOK({keywords: []});
testOK({keywords: [], extendDefaults: true}); // noop
testOK({keywords: [], extendDefaults: false}); // disable admonitions
testOK({tag: '+++', keywords: ['info', 'tip']});
testOK({tag: '+++', keywords: ['custom-keyword'], extendDefaults: true});
testOK({tag: '+++', keywords: ['custom-keyword'], extendDefaults: false});
testFail(3);
testFail([]);
testFail({unknownAttribute: 'val'});
testFail({tag: ''});
testFail({keywords: []});
testFail({keywords: ['custom-keyword'], extendDefaults: 42});
// Legacy types
testFail({