diff --git a/gradle/changelog/copy_permalink.yaml b/gradle/changelog/copy_permalink.yaml new file mode 100644 index 0000000000..43c33c11e6 --- /dev/null +++ b/gradle/changelog/copy_permalink.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Permalink generation for line numbers in code view diff --git a/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx b/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx index 82c2485c9f..e355737600 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/content/SourcecodeViewer.tsx @@ -38,7 +38,7 @@ const SourcecodeViewer: FC = ({ file, language }) => { return ; } - const permalink = replaceBranchWithRevision(location.pathname, file.revision); + const permalink = replaceBranchWithRevision(location.pathname, encodeURIComponent(file.revision)); return ; }; diff --git a/scm-ui/ui-webapp/src/repos/sources/components/content/SwitchableMarkdownViewer.tsx b/scm-ui/ui-webapp/src/repos/sources/components/content/SwitchableMarkdownViewer.tsx index 80e45e2a8e..fc3fe9fc85 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/content/SwitchableMarkdownViewer.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/content/SwitchableMarkdownViewer.tsx @@ -47,7 +47,7 @@ const SwitchableMarkdownViewer: FC = ({ file, basePath, repository }) => return ; } - const permalink = replaceBranchWithRevision(location.pathname, file.revision); + const permalink = replaceBranchWithRevision(location.pathname, encodeURIComponent(file.revision)); return (