Skip to content

Commit c137f91

Browse files
garvinhickinglinawolf
authored andcommitted
[BUGFIX] Also apply premalink URI normalization for rstAnchor case
Replacing "typo3/cms-xxx" with "typo3-cms-xxx" needs to happen at an earlier place.
1 parent fdaec36 commit c137f91

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/typo3-docs-theme/assets/js/link-reference-modal.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
function generateShortUri(linkReferenceModal, section, headerText, rstAnchor, filename) {
2121
const urlPrefix = 'https://docs.typo3.org/permalink/';
2222
const interlinkTarget = linkReferenceModal.dataset.interlinkShortcode || 'somemanual';
23+
// Replaces a link like "typo3/cms-sys-note" to "typo3-cms-sys-note" (https://docs.typo3.org/permalink/typo3-cms-sys-note:for-editors)
24+
const adjustedInterlinkTarget = interlinkTarget.replaceAll('/', '-', interlinkTarget);
25+
2326
if (rstAnchor) {
24-
return urlPrefix + `${interlinkTarget}:${rstAnchor}`;
27+
return urlPrefix + `${adjustedInterlinkTarget}:${rstAnchor}`;
2528
}
2629
if (filename === '') {
2730
return '';
2831
}
2932

30-
// Replaces a link like "typo3/cms-sys-note" to "typo3-cms-sys-note" (https://docs.typo3.org/permalink/typo3-cms-sys-note:for-editors)
31-
const adjustedInterlinkTarget = interlinkTarget.replaceAll('/', '-', interlinkTarget);
3233
// @todo - check how anchor hashes + filenames work with redirects? Other edge cases?
3334
return urlPrefix + `${adjustedInterlinkTarget}:${filename}#${section?.id || ''}`;
3435
}

packages/typo3-docs-theme/resources/public/js/theme.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)