From 7680d32d15fc4bb6f71bfc45a58c08b482c269ce Mon Sep 17 00:00:00 2001 From: D V <77478658+DarhkVoyd@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:36:36 +0530 Subject: [PATCH] fix edit on page (#749) --- components/DocsHelp.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/DocsHelp.tsx b/components/DocsHelp.tsx index 2adc905ff..cd90172f5 100644 --- a/components/DocsHelp.tsx +++ b/components/DocsHelp.tsx @@ -1,5 +1,6 @@ import { useRouter } from 'next/router'; import React, { FormEvent, useRef, useState } from 'react'; +import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment'; interface DocsHelpProps { markdownFile?: string; @@ -275,7 +276,7 @@ export function DocsHelp({ markdownFile }: DocsHelpProps) { target='_blank' rel='noreferrer' className='px-[16px] py-[8px] cursor-pointer border-solid border-[#aaaaaa] border rounded-md hover:bg-gray-200 dark:hover:bg-gray-600' - href={`https://github.com/json-schema-org/website/blob/main/pages${markdownFile ? (markdownFile === '_indexPage' ? router.asPath + '/_index.md' : router.asPath + '.md') : `/${path}/index.page.tsx`}`} + href={`https://github.com/json-schema-org/website/blob/main/pages${markdownFile ? (markdownFile === '_indexPage' ? extractPathWithoutFragment(router.asPath) + '/_index.md' : extractPathWithoutFragment(router.asPath) + '.md') : `/${path}/index.page.tsx`}`} >