diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2019-01-28 11:11:51 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-01-28 20:21:01 +0100 |
commit | d2f6a51f791ab430da08bea7dc46373288274ffb (patch) | |
tree | d330ea0855b5c2b54734f80b79cbf1cf65c17c08 | |
parent | 37075a58cbab2c5b1dbcc8bba42697f72d3dbacc (diff) | |
download | sonarqube-d2f6a51f791ab430da08bea7dc46373288274ffb.tar.gz sonarqube-d2f6a51f791ab430da08bea7dc46373288274ffb.zip |
Fix dynamic links replacing in static doc
-rw-r--r-- | server/sonar-docs/src/pages/instance-administration/project-move.md | 6 | ||||
-rw-r--r-- | server/sonar-docs/src/templates/page.tsx | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/server/sonar-docs/src/pages/instance-administration/project-move.md b/server/sonar-docs/src/pages/instance-administration/project-move.md index e4ce1de9219..ca5fd9056c2 100644 --- a/server/sonar-docs/src/pages/instance-administration/project-move.md +++ b/server/sonar-docs/src/pages/instance-administration/project-move.md @@ -35,12 +35,12 @@ A zip file containing all project data ex is generated in _$SONAR_SOURCE_HOME/da ## How To Import On the target instance: -* With a user having the "Administer System" and "Create Projects" permissions, go to **[Administration > Projects > Management](/#sonarqube-admin#/admin/projects_management/)** and [provision the project](/project-administration/project-existence/) using the same key the project had in the source instance. +* With a user having the "Administer System" and "Create Projects" permissions, go to [**Administration > Projects > Management**](/#sonarqube-admin#/admin/projects_management/) and [provision the project](/project-administration/project-existence/) using the same key the project had in the source instance. * Configure the Project's permissions, and the Quality Profiles and Quality Gate associated to the Project -* Put the generated zip file into the directory _$SONAR_TARGET_HOME/data/governance/project_dumps/import_ +* Put the generated zip file into the directory *$SONAR\_TARGET\_HOME/data/governance/project_dumps/import* * Go to the Project's Home Page and choose **Administration > Import / Export** * Click on the Import button to start importing your data -** Source code is not included in the zip file. Once the import is finished, trigger an analysis to import source files into the new instance. +* Source code is not included in the zip file. Once the import is finished, trigger an analysis to import source files into the new instance. Notes: diff --git a/server/sonar-docs/src/templates/page.tsx b/server/sonar-docs/src/templates/page.tsx index 11b25083c3f..b468d39971c 100644 --- a/server/sonar-docs/src/templates/page.tsx +++ b/server/sonar-docs/src/templates/page.tsx @@ -128,7 +128,7 @@ export const query = graphql` function replaceImageLinks(content: string) { const version = process.env.GATSBY_DOCS_VERSION || ''; if (version !== '') { - content = content.replace(/<img src="\/images\/(.*)"/gim, `<img src="/${version}/images/$1"`); + content = content.replace(/<img src="\/images\/(.*?)"/gim, `<img src="/${version}/images/$1"`); } return content; } @@ -136,12 +136,13 @@ function replaceImageLinks(content: string) { function replaceDynamicLinks(content: string) { // Make outside link open in a new tab content = content.replace( - /<a href="http(.*)">(.*)<\/a>/gim, + /<a href="http(.*?)">(.*?)<\/a>/gim, '<a href="http$1" target="_blank">$2</a>' ); + // Render only the text part of links going inside the app return content.replace( - /<a href="(.*)\/#(?:sonarqube|sonarcloud|sonarqube-admin)#.*">(.*)<\/a>/gim, + /<a href="(.*)\/#(?:sonarqube|sonarcloud|sonarqube-admin)#.*?">(.*?)<\/a>/gim, '$2' ); } |