Skip to content

Commit

Permalink
Only articles. Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Dec 17, 2024
1 parent bbb0bfb commit 7f47b8e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e2e/apiMocks/versions.spec.ts_Open_previews.har

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ test("urls are parsed correctly", async () => {
const taxonomyContextUrls = [
"https://ndla.no/r/06b775d81a",
"https://ndla.no/r/kroppsoving-vg1/kroppslig-laring-og-parkour-okt-1/06b775d81a",
"https://test.ndla.no/f/kroppsoving-vg1/06b775d81a",
"https://ndla.no/e/kroppsoving-vg3/parkour/f9d2bbbb98",
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/SlateEditor/plugins/link/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const isNDLAArticleUrl = (url: string) => /^http(s)?:\/\/((.*)\.)?ndla.no
export const isNDLATaxonomyUrl = (url: string) =>
/^http(s)?:\/\/((.*)\.)?ndla.no\/((.*)\/)?subject:(.*)\/topic(.*)/.test(url);
export const isNDLATaxonomyContextUrl = (url: string) =>
/^http(s)?:\/\/((.*)\.)?ndla.no\/((.*)\/)?(f|e|r)\/(.*)\/?(.*)\/?[a-z0-9]{10}/.test(url);
/^http(s)?:\/\/((.*)\.)?ndla.no\/((.*)\/)?(e|r)\/(.*)\/?(.*)\/?[a-z0-9]{10}/.test(url);
export const isNDLALearningPathUrl = (url: string) =>
/^http(s)?:\/\/((.*)\.)?ndla.no\/((.*)\/)?learningpaths\/(.*)/.test(url);
export const isNDLAEdPathUrl = (url: string) =>
Expand Down

0 comments on commit 7f47b8e

Please sign in to comment.