mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
fix(v2): less strict blog/docs uri frontmatter validation (#5032)
This commit is contained in:
parent
425eccc5df
commit
f20599bb54
7 changed files with 151 additions and 52 deletions
|
@ -25,8 +25,11 @@ export const RehypePluginsSchema = MarkdownPluginsSchema;
|
|||
|
||||
export const AdmonitionsSchema = Joi.object().default({});
|
||||
|
||||
// TODO how can we make this emit a custom error message :'(
|
||||
// Joi is such a pain, good luck to annoying trying to improve this
|
||||
export const URISchema = Joi.alternatives(
|
||||
Joi.string().uri({allowRelative: true}),
|
||||
// This custom validation logic is required notably because Joi does not accept paths like /a/b/c ...
|
||||
Joi.custom((val, helpers) => {
|
||||
try {
|
||||
const url = new URL(val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue