Skip to content

Commit f66a318

Browse files
docs-botCopilot
andauthored
Fix [AUTOTITLE] ( link corruption in translation correction script (#62691)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e926e69 commit f66a318

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/languages/lib/correct-translation-content.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,9 @@ export function correctTranslatedContentStrings(
21982198
content = content.replaceAll('["AUTOTITLE]', '"[AUTOTITLE]')
21992199
content = content.replaceAll('[ AUTOTITLE](', '[AUTOTITLE](')
22002200
content = content.replaceAll('[ "AUTOTITLE](', '[AUTOTITLE](')
2201+
// Extra space between the closing `]` and opening `(` breaks the Markdown
2202+
// link so it renders as literal text instead of a hyperlink.
2203+
content = content.replaceAll('[AUTOTITLE] (', '[AUTOTITLE](')
22012204

22022205
// Double-brace Liquid tag corruptions.
22032206
content = content.replaceAll('{{% octicon', '{% octicon')

src/languages/tests/correct-translation-content.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,9 @@ describe('correctTranslatedContentStrings', () => {
16231623
expect(fix('["AUTOTITLE](/path)', 'es')).toBe('"[AUTOTITLE](/path)')
16241624
expect(fix('[ AUTOTITLE](/path)', 'es')).toBe('[AUTOTITLE](/path)')
16251625
expect(fix('[ "AUTOTITLE](/path)', 'es')).toBe('[AUTOTITLE](/path)')
1626+
expect(fix('[AUTOTITLE] (/path)', 'es')).toBe('[AUTOTITLE](/path)')
1627+
// Already-correct input is left unchanged.
1628+
expect(fix('[AUTOTITLE](/path)', 'es')).toBe('[AUTOTITLE](/path)')
16261629
})
16271630

16281631
test('fixes double-brace Liquid tag corruptions', () => {

0 commit comments

Comments
 (0)