diff --git a/src/web/src/components/Posts/Commits.tsx b/src/web/src/components/Posts/Commits.tsx index d2e71529c6..eefd625ab6 100644 --- a/src/web/src/components/Posts/Commits.tsx +++ b/src/web/src/components/Posts/Commits.tsx @@ -34,7 +34,8 @@ const useStyles = makeStyles((theme: Theme) => }) ); -const getCommitNumber = (url: string) => url.replace(/.+\/(commit|commits)\/(\w{40}).*/, '$2'); +const getCommitNumber = (url: string, length?: number) => + url.replace(/.+\/(commit|commits)\/(\w{40}).*/, '$2').substr(0, length); type Props = { commitUrls: string[]; @@ -56,10 +57,10 @@ const Commits = ({ commitUrls }: Props) => { href={`https://github.com${url}`} rel="bookmark" target="_blank" - title={'Commit #' + getCommitNumber(url)} + title={'Commit' + getCommitNumber(url)} className={classes.link} > - #{getCommitNumber(url).substr(0, 6)} + {getCommitNumber(url, 6)}

))}