Skip to content

Commit

Permalink
Allow relative path for edit url
Browse files Browse the repository at this point in the history
  • Loading branch information
nhle-mgmtp committed May 16, 2021
1 parent bcec823 commit 9cf4c73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,12 @@ describe('validateDocFrontMatter', () => {
testField({
fieldName: 'custom_edit_url',
validFrontMatters: [
{custom_edit_url: null},
{custom_edit_url: 'https://github.com/facebook/docusaurus/markdown.md'},
// See https://github.com/demisto/content-docs/pull/616#issuecomment-827087566
{custom_edit_url: ''},
],
invalidFrontMatters: [
[{custom_edit_url: '../../api/docs/markdown.md'}, 'must be a valid uri'],
[{custom_edit_url: '@site/api/docs/markdown.md'}, 'must be a valid uri'],
{custom_edit_url: null},
{custom_edit_url: 'https://github.com/facebook/docusaurus/markdown.md'},
{custom_edit_url: '../../api/docs/markdown.md'},
{custom_edit_url: '@site/api/docs/markdown.md'},
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DocFrontMatterSchema = Joi.object<DocFrontMatter>({
slug: Joi.string(),
sidebar_label: Joi.string(),
sidebar_position: Joi.number().min(0),
custom_edit_url: Joi.string().uri().allow('', null),
custom_edit_url: Joi.string().uri({allowRelative: true}).allow('', null),
parse_number_prefixes: Joi.boolean(),
}).unknown();

Expand Down

0 comments on commit 9cf4c73

Please sign in to comment.