diff --git a/www/packages/docs-ui/src/components/Note/Layout/index.tsx b/www/packages/docs-ui/src/components/Note/Layout/index.tsx index f2f3fa5084..d1b12493ae 100644 --- a/www/packages/docs-ui/src/components/Note/Layout/index.tsx +++ b/www/packages/docs-ui/src/components/Note/Layout/index.tsx @@ -10,6 +10,8 @@ type StringInfo = { type NoteLayoutProps = NoteProps +const PUNCTIONATIONS = [".", ":", ";", ",", "!", "?"] + export const NoteLayout = ({ type, title, @@ -84,6 +86,12 @@ export const NoteLayout = ({ } }, [children, forceMultiline]) + const showColon = useMemo(() => { + const lastChar = title?.charAt(title.length - 1) || "" + + return !PUNCTIONATIONS.includes(lastChar) + }, [title]) + return (
- {title}:  + {title} + {showColon ? ":" : ""}  {allStringChildren && (