diff --git a/packages/core/dev-test/config.yml b/packages/core/dev-test/config.yml index 6b5c93a9..8b7023a9 100644 --- a/packages/core/dev-test/config.yml +++ b/packages/core/dev-test/config.yml @@ -75,7 +75,7 @@ collections: - label: Body name: body widget: markdown - hint: "*Main* __content__ __*goes*__ [here](example.com)." + hint: "*Main* __content__ __*goes*__ [here](https://example.com/)." - name: faq label: FAQ folder: _faqs diff --git a/packages/core/src/components/common/field/Hint.tsx b/packages/core/src/components/common/field/Hint.tsx index f1cbfb40..b6b512ed 100644 --- a/packages/core/src/components/common/field/Hint.tsx +++ b/packages/core/src/components/common/field/Hint.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback } from 'react'; import ReactMarkdown from 'react-markdown'; import gfm from 'remark-gfm'; @@ -6,7 +6,7 @@ import useCursor from '@staticcms/core/lib/hooks/useCursor'; import classNames from '@staticcms/core/lib/util/classNames.util'; import { generateClassNames } from '@staticcms/core/lib/util/theming.util'; -import type { FC } from 'react'; +import type { FC, MouseEvent } from 'react'; import './Hint.css'; @@ -40,6 +40,10 @@ const Hint: FC = ({ }) => { const finalCursor = useCursor(cursor, disabled); + const handleOnClick = useCallback((event: MouseEvent) => { + event.stopPropagation(); + }, []); + return (
= ({ variant === 'inline' && classes.inline, className, )} + onClick={handleOnClick} >