mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-16 18:46:57 +02:00
feat: allow numbers in plugin ID (#6656)
* fix example for id that didn't respect regex example for id don't work with version 2.0.0-beta.15: ValidationError: "id" with value "docs1" fails to match the required pattern: /^[a-zA-Z_-]+$/ Error: Process completed with exit code 1. * properly fix Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
10a5f71154
commit
1cd4757828
3 changed files with 9 additions and 5 deletions
packages/docusaurus-utils-validation/src
|
@ -11,7 +11,10 @@ import type {Tag} from '@docusaurus/utils';
|
|||
import {JoiFrontMatter} from './JoiFrontMatter';
|
||||
|
||||
export const PluginIdSchema = Joi.string()
|
||||
.regex(/^[a-zA-Z_-]+$/)
|
||||
.regex(/^[a-zA-Z0-9_-]+$/)
|
||||
.message(
|
||||
'Illegal plugin ID value "{#value}": it should only contain alphanumerics, underscores, and dashes.',
|
||||
)
|
||||
.default(DEFAULT_PLUGIN_ID);
|
||||
|
||||
const MarkdownPluginsSchema = Joi.array()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue