fix(v2): allow relative URLs in URISchema #3449

This commit is contained in:
Tom Milligan 2020-09-29 17:34:39 +01:00 committed by GitHub
parent 55cd7a7b5a
commit fe78cbeff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -26,7 +26,7 @@ export const RehypePluginsSchema = MarkdownPluginsSchema;
export const AdmonitionsSchema = Joi.object().default({});
export const URISchema = Joi.alternatives(
Joi.string().uri(),
Joi.string().uri({allowRelative: true}),
Joi.custom((val, helpers) => {
try {
const url = new URL(val);