Skip to content

Commit 9405099

Browse files
authored
Merge pull request #31253 from github/repo-sync
Repo sync
2 parents cb99887 + ab5e0d1 commit 9405099

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/content-linter/lib/linting-rules/list-first-word-capitalization.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export const listFirstWordCapitalization = {
3636
if (firstWord.startsWith('[{%') || firstWord.startsWith('{%') || firstWord.startsWith('{{'))
3737
return
3838
// If the first letter is capitalized, it's not an error
39-
if (/[A-Z]/.test(firstWord[0])) return
39+
// And any special characters (like @) that can't be capitalized
40+
if (/[A-Z@]/.test(firstWord[0])) return
4041
// There are items that start with a number or words that contain numbers
4142
// e.g., x64
4243
if (/\d/.test(firstWord)) return

src/content-linter/tests/unit/list-first-word-captitalization.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ describe(listFirstWordCapitalization.names.join(' - '), () => {
5151
'- {% data variables.product.prodname_dotcom_the_website %} Services Continuity and Incident Management Plan',
5252
'- {% data variables.product.prodname_dotcom_the_website %} Services Continuity and Incident Management Plan',
5353
'- x64',
54+
'- @mention your friends',
55+
'- @hash tags',
5456
'- 05:00',
5557
].join('\n')
5658
const result = await runRule(listFirstWordCapitalization, { strings: { markdown } })

0 commit comments

Comments
 (0)