Browse Source

SONAR-12000 Accept links with anchors in the brokenlink safety net of the doc

tags/7.8
Grégoire Aubert 5 years ago
parent
commit
04b5f2b818
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      server/sonar-docs/src/__tests__/BrokenLinkSafetyNet.test.js

+ 3
- 2
server/sonar-docs/src/__tests__/BrokenLinkSafetyNet.test.js View File

@@ -137,8 +137,9 @@ function checkContentUrl(files) {
!node.url.startsWith('http') &&
!node.url.startsWith('/#')
) {
// Check markdown file path validity
if (!urlExists(parsedFiles, node.url)) {
// Check markdown file path validity, and ignore anchors
const url = node.url.split('#')[0];
if (!urlExists(parsedFiles, url)) {
console.log('[', node.url, '] is not a valid link, in', file.path + '.md');
hasErrors = true;
}

Loading…
Cancel
Save