File tree Expand file tree Collapse file tree
src/discussions/posts/post Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,8 +54,17 @@ const PostLink = ({
5454 // For comments/responses, show parent thread title with arrow
5555 const displayTitle = ( type === 'response' || type === 'comment' ) && threadTitle ? threadTitle : title ;
5656
57+ // Strip render_id suffix (e.g., "-thread", "-response", "-comment") for navigation
58+ const stripRenderIdSuffix = ( idValue ) => {
59+ if ( typeof idValue === 'string' ) {
60+ return idValue . replace ( / - ( t h r e a d | r e s p o n s e | c o m m e n t ) $ / , '' ) ;
61+ }
62+ return idValue ;
63+ } ;
64+
5765 // For comments/responses, navigate to the parent thread instead of the comment itself
58- const navigationPostId = ( type === 'response' || type === 'comment' ) && commentThreadId ? commentThreadId : postId ;
66+ const rawNavigationId = ( type === 'response' || type === 'comment' ) && commentThreadId ? commentThreadId : postId ;
67+ const navigationPostId = stripRenderIdSuffix ( rawNavigationId ) ;
5968
6069 const { pathname } = discussionsPath ( Routes . COMMENTS . PAGES [ page ] , {
6170 0 : enableInContextSidebar ? 'in-context' : undefined ,
You can’t perform that action at this time.
0 commit comments